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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
eunji888888
Frequent Visitor

Correct row values but wrong grand total value

I have created the measure:
Measure = SUM('table'[value])/SUM('table'[Qty])
 
It gives the correct row values but wrong in grand total.
 
Do anyone have the idea to solve this problem?
2 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @eunji888888 "
Try :

Measure = SUMx('table','table'[value])/SUM('table'[Qty])

If it won't work :

please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

vicky_
Super User
Super User

it's a common "problem". see the following blog post - https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/5... or https://www.sqlbi.com/articles/summing-values-for-the-total/ 

but tldr your measure is returning the value (in the totals row) / the qty (in your total row), which i suspect is not what you want.

View solution in original post

2 REPLIES 2
vicky_
Super User
Super User

it's a common "problem". see the following blog post - https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/5... or https://www.sqlbi.com/articles/summing-values-for-the-total/ 

but tldr your measure is returning the value (in the totals row) / the qty (in your total row), which i suspect is not what you want.

Ritaf1983
Super User
Super User

Hi @eunji888888 "
Try :

Measure = SUMx('table','table'[value])/SUM('table'[Qty])

If it won't work :

please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.