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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Applicable88
Impactful Individual
Impactful Individual

Running Total without calculate?

Hello,

is there a way to compute running total without the calculate function? For example via creating a table variable inside a measure and sum it up via sumx?

With this sample data:

 

Date Sales
01.01.2021 123
02.01.2021 423
03.01.2021 535
04.01.2021 66
05.01.2021 22
06.01.2021 11
07.01.2021 11
08.01.2021 33
09.01.2021 44

Thank you very much in advance. 

 

 

Best. 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Applicable88 Yes:

Measure =
  VAR __Date = MAX('Table'[Date])
RETURN
  SUMX(FILTER(ALL('Table',[Date] <= __Date),[Sales])


Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@Applicable88 Yes:

Measure =
  VAR __Date = MAX('Table'[Date])
RETURN
  SUMX(FILTER(ALL('Table',[Date] <= __Date),[Sales])


Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Just me, or is there a missing paren in this?

 

Measure =
VAR __Date = MAX('Table'[Date])
RETURN
SUMX(FILTER(ALL('Table',[Date] <= __Date),[Sales])

No doubt, it's your most favooooooooorite way to kick off CALCULATE. 🤣


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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