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
Grellow
Frequent Visitor

Change measure value in total row

Hi!

I want a measure that uses one formula on each row and subtotal row, but a different formula on the total row.

Example from Contoso sample data set:

Grellow_0-1675689268532.png

In the Total row in the right hand column, I want to show the totals of the percentages at Continent level -- in this case 57.23+57.33+57.50 = 172.06.  (I know it's not a realistic example, but it matches something I'm trying to do with real data.)

The [GM pct] variable is just showing Gross Margin as a % of Sales:

Grellow_1-1675689366122.png

I've got this far with the formula for my total:

Grellow_2-1675676624269.png

I know that the IF(HASONEVALUE()) part is working. But I can't find the syntax to sum the values of [GM pct].

Note that [GM pct] is a MEASURE not a column, so I can't use SUM. The visual contains a lot of other complex measures that I don't want to recreate by building a new table.

Thanks for any help 😀

1 ACCEPTED SOLUTION

I realised I posted this in the wrong part of the forum.

This question was answered for me in another thread, here:
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Different-formula-in-total-row/m-p/3075379#M1...

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Grellow , Better to use isinscope

 

You have to try GT like

Sumx(Values(Table[Contient Name]), [GM Pct])

 

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

 

 

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

Hi @amitchandak 

Thanks so much for your reply. I couldn't use the ISINSCOPE solution, because I'm not working with tables & columns but only Measures. 

However, your syntax for SUMX(VALUES(... did the job. THANK YOU!

Unfortunately I now have a more complicated version of the same puzzle.

Your formula is in the blue cells, and gives exactly what I wanted.

Grellow_0-1676059492098.png

But I now need a second calculation with a different formula, for the red column. 

The calculation I have so far is this one:

Grellow_1-1676059507786.png

I am getting the right results in cells A, B, C — summing up the values at Product.Category level. So, for example, cell B is the sum of the calculations for all the Categories within Europe. That’s what I need.

But in the Grand Total row I also need a sum of A+B+C, which here should be 10.3438.

I can’t get my head around what I would need for that …

Huge thanks again for any help 😀

I realised I posted this in the wrong part of the forum.

This question was answered for me in another thread, here:
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Different-formula-in-total-row/m-p/3075379#M1...

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.