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

DAX formula to cumulative values based on a column

I need a formula for the Cumulative of the "Minut" evety time we change the event number.

 

EVENT  Minut     Cumulative

97            2           5

97            3           5

98           18        24 

98            2         24

98            1         24

98            3         24  

99            6         11

99            4         11

99            1         11

 

What is the recommended simple DAX for such operation?

2 ACCEPTED SOLUTIONS
PaulDBrown
Community Champion
Community Champion

@Anonymous 

If you wish to see all the rows, you will need to add an index column to your table (otherwise the values get aggregated by "Event")

The try this measure to get the aggregate for each event:

 

Total by Event = CALCULATE([Sum of Minut]; ALLEXCEPT(Table1; Table1[Event]))

 

To get the actual cumulative :

 

Cumulative = CALCULATE([Sum of Minut];
            FILTER(ALL(Table1);
            Table1[Event]<=MAX(Table1[Event]))
            )

 

 

And this is the result:

Result.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

v-yiruan-msft
Community Support
Community Support

Hi @elmorlc,

You can create one measure as below:

Cumulative = CALCULATE(SUM('Events'[Minut]),ALLEXCEPT('Events','Events'[EVENT]))

Cumulative.jpg

Best Regards

Rena

Community Support Team _ Rena
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

3 REPLIES 3
v-yiruan-msft
Community Support
Community Support

Hi @elmorlc,

You can create one measure as below:

Cumulative = CALCULATE(SUM('Events'[Minut]),ALLEXCEPT('Events','Events'[EVENT]))

Cumulative.jpg

Best Regards

Rena

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

@Anonymous 

If you wish to see all the rows, you will need to add an index column to your table (otherwise the values get aggregated by "Event")

The try this measure to get the aggregate for each event:

 

Total by Event = CALCULATE([Sum of Minut]; ALLEXCEPT(Table1; Table1[Event]))

 

To get the actual cumulative :

 

Cumulative = CALCULATE([Sum of Minut];
            FILTER(ALL(Table1);
            Table1[Event]<=MAX(Table1[Event]))
            )

 

 

And this is the result:

Result.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






amitchandak
Super User
Super User

Create a new column

New column = sumx(filter(table,table[EVENT]=earlier(table[EVENT])),table[Minut])

 

Appreciate your Kudos.

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.