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
Anonymous
Not applicable

Running total of measure

Hi,

I want to find the Running total of a measure, can you please help me with it, below are the details

This is how my current data is

 

 Current.JPG

 

 

 Expected result

Vertical01-Apr-2018-AltrRunning total
Analytics1616
UET420
DE020
ECM323
Mobility124
Sharepoint327
EWT330
Digital636

 

Thanks,

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 

First, please add a group index column in Query Editor like below:

#"Grouped Rows" = Table.Group(#"Changed Type", {"Vertical"}, {{"All", each _, type table}}),
#"Added Index" = Table.AddIndexColumn(#"Grouped Rows", "Index", 1, 1),

1.PNG

 

Then, create measure for running total.

running total =
SUMX (
    FILTER ( ALL ( Digital ), Digital[Index] <= SELECTEDVALUE ( Digital[Index] ) ),
    [01-Apr-2018-Atr]
)

2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 

First, please add a group index column in Query Editor like below:

#"Grouped Rows" = Table.Group(#"Changed Type", {"Vertical"}, {{"All", each _, type table}}),
#"Added Index" = Table.AddIndexColumn(#"Grouped Rows", "Index", 1, 1),

1.PNG

 

Then, create measure for running total.

running total =
SUMX (
    FILTER ( ALL ( Digital ), Digital[Index] <= SELECTEDVALUE ( Digital[Index] ) ),
    [01-Apr-2018-Atr]
)

2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks @v-yulgu-msft that worked for me:)

Greg_Deckler
Super User
Super User

Take a look at my Time Intelligence The Hard Way quick measure here:

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...

 

Basically, you need to do a SUMMARIZE and then return the SUMX of all the rows that are less than the current row value that your running total is based on. So you will get the MAX of the date value in a VAR and then SUMMARIZE and then SUMX of the FILTER of your SUMMARIZE table for all dates less than the MAX in your first VAR. Basically like that.


@ 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...
Anonymous
Not applicable

Thanks for your Reply @Greg_DecklerUsing Rank.JPG. I am able to follow your Idea, but in this case I am not using the Dates to compare and do a summarization. I have to just do a cumulative sum of the data from the measure, I have tried it using Ranking and I am able to get the Cumulative sum, but my Vertical sort order has to be changed and that makes the data wrong.

Kindly let me know if you have any solution to this scenario and if you need any other inputs.

 

 

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.