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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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