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
Guuske
Regular Visitor

Cumulative Amounts

Hi,

 

This is my first my question so I hope I write it down correctly and yes I am inexperienced with Power BI. I have the following dataset:

 

Column A (index) / Column B (amount)

1                                 2

2                                -1

3                                -0.5

4                                -0.5

5                                3.5

 

What I would like to achieve is a third Column that shows me the som per row. Don't know how to say this in other words. With Excel this is an easy calculation hopefully it is the same with Power BI.

The result I would like to see:

 

Column A (index) / Column B (amount) / Column C (total)

1                                 2                                  2

2                                -1                                 1

3                                -0.5                               0.5

4                                -0.5                               0

5                                3.5                                3.5

 

What is the quickest way to achieve this?

1 ACCEPTED SOLUTION

Thank you for the push in the right direction. While testing I made the following correction:

 

Amount running total in Amount =
CALCULATE(
 SUM('Table1'[Amount]);
 FILTER(
  ALLSELECTED('Table1'[Index]);
  ISONORAFTER('Table1'[Index]; MAX('Table1'[Index]); DESC)
 )
)

 

Thanks for your quick response.

View solution in original post

4 REPLIES 4
LigiaRoberts
New Member

Hi,

 

Given that ISONORAFTER is not available when in direct query mode, is there a way around this ?

 

Best wishes

Greg_Deckler
Super User
Super User

Oh, wait, just use a Running Total Quick Measure:

 

Amount running total in Amount = 
CALCULATE(
	SUM('Amounts'[Amount]),
	FILTER(
		ALLSELECTED('Amounts'[Amount]),
		ISONORAFTER('Amounts'[Amount], MAX('Amounts'[Amount]), DESC)
	)
)

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

Thank you for the push in the right direction. While testing I made the following correction:

 

Amount running total in Amount =
CALCULATE(
 SUM('Table1'[Amount]);
 FILTER(
  ALLSELECTED('Table1'[Index]);
  ISONORAFTER('Table1'[Index]; MAX('Table1'[Index]); DESC)
 )
)

 

Thanks for your quick response.

Greg_Deckler
Super User
Super User

Well, I can tell you that it will probably involve the EARLIER function.


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

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.