Anonymous's avatar
Anonymous
Not applicable
9 years ago

Running total

NAME:

Running total performance measure

 

DESCRIPTION:

Calculate the running total of some column containing numerical values over any given period of time.

 

PARAMETERS:

Name: Base value

Tooltip: The value you want to measure the running total performance on.

Type: Numerical field / measure

 

Name: Dates

Tooltip: The dates interval wherein you want to calculate the running total.

Type: Date field

 

DAX:

Approach if you have a time dimension:

 

Running total of {Base value} =

Calculate(

 SUM({Base value}),

 FILTER(

  (ALL({Dates}),

  {Dates} <= MAX ( {Dates from time dimension} )

 )

)

 

Approach if you don't have a time dimension (this will only work if you have a row for each period of {Dates} in your date column):

 

Running total of {Base value} =

Calculate(

 SUM({Base value}),

 FILTER(

  (ALL({Dates}),

  {Dates} <= MAX ( {Dates} )

 )

)

 

 

If you take a look at the .pbix, you'll find syntax for creating a time dimension and making the monthname + year column.

 

Don't hesitate to ask about the measure. I'll gladly elaborate on anything regarding it.

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    I've edited a little in the post. There were a typo in the DAX formulas.

    • wynhopkins's avatar
      wynhopkins
      Most Valuable Professional

      I'd really like to see this implemented.   I'd label this Lifetime To Date

      • ArulselvanD07's avatar
        ArulselvanD07
        Helper I

        Hi Anonymous Is it possible to calculate running total for a measure instead of a physical column? Please let me know, thanks

  • Anonymous's avatar
    Anonymous
    Not applicable

    I have DataSet like Three Years(2016,2017,2018) and Want to show in line chart running total with X-axis as Month of every year and Y-axis having Price. When i implemented this dax for 2016,2017,2018 all are overlapping(having same value).

    • ArulselvanD07's avatar
      ArulselvanD07
      Helper I

      Hi Anonymous,

       

      Pls share the data, your current result and the expected results. If possible please share the pbix file as well.

       

      Thanks

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi ArulselvanD07 

         

        Thanks I have figured it out where i was wrong. I just updated your DAX as per my requirements. Now its working fine.