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
denpries
Resolver I
Resolver I

Sum of column, of rows above

Dear all.

 

Question. I have a sales LY and CY and a delta. Also some keys such as soldto and material. 

 

I put these in a matrix.

 

[Single key, but in hierarchy] [LY] [CY] [Delta] [Value if decreasing] [Value if increasing]

All values are measures.

 

For example:

 

Netherlands | 100 | 120 | 20 | blank | 20
Belgium | 100 | 80 | -20 | -20 | blank

Germany | 200 | 250 | 50 | blank | 50

 

Now the tricky part is, the total doesnt work as i want. I dont want the total to show  -20 + 20 + 50 = +50.
I want to show: decreasing = -20, increasing = +70. how?

3 REPLIES 3
denpries
Resolver I
Resolver I

That said, no measure whatsoever can grasp the total values as wished in the start post. It's simply impossible to know that in total, all the stuff in their respective contexts above in the table itself, add up to X. The reason for this is that the measure can't possibly know which context to use.
Greg_Deckler
Super User
Super User

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


@ 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...

Thanks for your answer but unfortunately this is not convenient in case you have multiple levels in hierarchy and use the same measure in other charts with different hierarchies as well. So the has one filter approach doesn't work there unfortunately.

I know it is 'by design' that the context of the table total row defines the result, not the rows above it. However it is very hard to tell a customer 'I can't add up all rows together in one total if you want the charts to be multi-layer-hierarchies as well'.

As far as I'm concerned, totals should have the option to simply sum up the above rows (the excel way) OR behave contextually like design is now.

Building seperate measures for each individual table or matrix context simply doesn't work.

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.