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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
mhgottsc
Helper I
Helper I

Need help with running total

I am atemting to get a running total from the start of wnd of 2019 to the current date. Included is a picture of my dax code that is not currently working. Thanks!

mhgottsc_0-1640629732776.png

 

1 ACCEPTED SOLUTION

I was able to fix it by making a my own date table and using this code:

Total Revenue running total in Quarter =
CALCULATE(
    SUM('Matt-DataForBI'[Total Revenue]),
    FILTER(
        ALLSELECTED('Date'[Quarter]),
        ISONORAFTER('Date'[Quarter], MAX('Date'[Quarter]), DESC)
    )
)

View solution in original post

6 REPLIES 6
VahidDM
Super User
Super User

Hi @mhgottsc 

 

You need to add a Date table [Calendar Table] to your report.
To work with Data Analysis Expressions (DAX) time intelligence functions, there's a prerequisite model requirement: You must have at least one date table in your model.

 

Check this link:

https://www.vahiddm.com/post/creating-calendar-table-with-3-steps

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

AlexisOlson
Super User
Super User

Does it help at all if you replace the ISONORAFTER line with the following?

'Matt-DataForBI'[Date Closed] <= MAX ( 'Matt-DataForBI'[Date Closed] )

 

I tried that an unfortentetly it doesnt. 

Hmm. What if you replace ALLSELECTED ( 'Matt-DataForBI'[Date Closed] ) with ALLSELECTED ( 'Matt-DataForBI' )?

I was able to fix it by making a my own date table and using this code:

Total Revenue running total in Quarter =
CALCULATE(
    SUM('Matt-DataForBI'[Total Revenue]),
    FILTER(
        ALLSELECTED('Date'[Quarter]),
        ISONORAFTER('Date'[Quarter], MAX('Date'[Quarter]), DESC)
    )
)

Great! Having a date dimension table is almost always a good idea.

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.