Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Dhjlm
Frequent Visitor

Need help with calculation

I have this problem giving me gray hair.

So I have customer no, sales, cost and cost of sales %.

The cost of sales % is correct for each customer no, but the total is wrong.

I would like it to be total sales divided with total cost, but instead it´s summarized.

Also the green visualizations is summarized, and choosing avarage or median also gives me the wrong result.

 

Dhjlm_1-1637157454093.png

 

4 REPLIES 4
v-janeyg-msft
Community Support
Community Support

Hi, @Dhjlm 

 

From your screenshot, we can't see how the 'cost of sales %' is calculated? So can you explain it? 
If it's a measure, you may need to modify it by using sum(summarize()) function to make the total correct.

And it's better to share some sample data and your desired result. So we can help you soon.

 

Best Regards,
Community Support Team _ Janey

amitchandak
Super User
Super User

@Dhjlm , will measure like that help ?

divide(Sum(Table[Cost]), Sum(Table[Sales]) )

Sorry, that didn´t help

mh2587
Super User
Super User

can you share your Dax ?


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.