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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ivvan_smo
New Member

Repeating subtotal for a filtered measure

Hi all, 

I wanted to ask, if you could help me with the issue below. 

 

I have similar power pivot with a measure, and I am looking for measure 2 (showing subtotals of the category for each row, but being able to filter in the pivot and measure will adjust):

ContinentCountryCityMeasureMeasure 2 ContinentCountryCityMeasureMeasure 2
EuropeUKLondon300450 EuropeUKLondon300400
EuropeUKLeeds100450 EuropeUKLeeds100400
EuropeUKBirmingham50450 Subtotal  400400
Subtotal  450450-->EuropeItalyRome75305
EuropeItalyRome75305 EuropeItalyPisa80305
EuropeItalyPisa80305 EuropeItalyMilan150305
EuropeItalyMilan150305 Subtotal  305305
Subtotal  305305      

 

I can create measure 2 with using all() and disregarding "City" column in the filter. However, if I filter out city  (as second table) in the pivot, measure 2 will not change as I have already excluded "City" in the filter. Can someone help? 

 

Thanks a lot, 

Ivan

2 REPLIES 2
Greg_Deckler
Super User
Super User

@ivvan_smo Not sure if I am 100% following but first, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler , 

thanks a lot, but unfortunately this is not an issue with measure totals (but I have used your advices for other projects earlier, thanks for that :)). 

 

Here the issue is, that I would like to repeat subtotals in each row of my pivot table (using DAX). 

 

For measure 2 (from above) I have used following command: 

measure 2= calculate(sum(table.variable XY), all(table.[city]) - this works perfectly as long as I do not filter in the pivot. As soon as I filter out some city, the measure two does not change to the value of new subtotal (e.g. excluding Birmingham and stay 450). 

Is there some workaround? I guess it has something to do with filters. 

 

Hope now it is more clear. 

 

Thanks, 

I.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors