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

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

Reply
Anonymous
Not applicable

Issue with sum on row and total values

I am using an if statement to check values and it works on row level but on total it uses the total line which give wrong totals

 

xxx % = if([QTY PY]=0,blank(), (([Average price CY]*[Qty CY]) / ([Average price PY]*[Qty CY]))-1)
 
Correct on row level but wrong on totals - how can I use a row total ? In Qlikview its easy to change this but how to in Power BI?
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

In Power BI, the total is not simply the sum of all row values, it will also calculate by the formula.

You may consider to create a new measure by using ISINSCOP() and SUMX() function.

https://docs.microsoft.com/en-us/dax/isinscope-function-dax 

https://docs.microsoft.com/en-us/dax/sumx-function-dax 

measure = IF(ISINSCOPE([axis column]),[xxx %],SUMX(ALLSELECTED('table'),[xxx %]))

It will return xxx % on row level and return the sum of xxx % at total field.

 

Best Regards,

Jay

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

In Power BI, the total is not simply the sum of all row values, it will also calculate by the formula.

You may consider to create a new measure by using ISINSCOP() and SUMX() function.

https://docs.microsoft.com/en-us/dax/isinscope-function-dax 

https://docs.microsoft.com/en-us/dax/sumx-function-dax 

measure = IF(ISINSCOPE([axis column]),[xxx %],SUMX(ALLSELECTED('table'),[xxx %]))

It will return xxx % on row level and return the sum of xxx % at total field.

 

Best Regards,

Jay

Pragati11
Super User
Super User

HI @Anonymous ,

 

This is a very common issue when creating measures. Chek the following article on how to resolve this:

https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.