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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. 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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.