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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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]) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors