# Set analysis question - Weighted %margin

Hi!

Hope someone can help me.

First of all, see attached file.

What I want is the middle gauge chart to show 54,6% and not the 51,7% it is showing now. It should calculate 11,8 / 21,6. Thoose numbers you will find in the totals of the table. Expressions: Weighted Margin (Row Total) / Weighted Margin (Row Total).

My problem is that the function Expression Total in this case is not giving me the same result as the function Row Total, and that is also why the gauge chart does not work.

Can I in some way modify below expression som that I get the same result for Expression Total as I get with Row Total, hence 21,6?

"

Sum

({<Category = p(Category),Supplier=>} Sales)*Sum(Sales)/sum(Total <Supplier>Sales)

"

The reason for above question is that I want to compare the margin of my suppliers with the overall margin for the categories that the supplier is related to. However, the overall margin needs to be weighted against the importance (in sales) of the related categorys for the the selected supplier.

Maybe we cannot not solve this issue by modifying the above expression, but in some other way. Please let me know.

Very thankful for help.

Best Regards