Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Running Total

Hi, I have a running total measure which is calculating sinec inception i.e. I want the running total to be adjsuted according to the year i choose from the slicer. When i choose the Year it get th...
  • amitchandak's avatar
    6 years ago

    Anonymous , issue is no clear with description you can try

    Saving Running Total test = CALCULATE([Total Usage Savings],
    FILTER(ALLselected('Dates'[Date]) ,
    'Dates'[Date] <= MAX('Dates'[Date]
    )))

     

    for yearly you can also try ytd

    YTD Sales = CALCULATE([Total Usage Savings],DATESYTD('Date'[Date],"12/31"))

  • Anonymous's avatar
    Anonymous
    6 years ago

    Anonymous  You can get this working by using this.

     

    Test Running Total = 
         Calculate(
              [Total Savings],
              FILTER( ALLSELECTED(Dates),
                     'Dates'[Date] <= MAX(Dates'[Date])
              )
          )

     

    However, if your Dates table has future date this behaves strange.
    I couldn't crack that, this happens because of the ALLSELECTED. Seems like I need to revisit ALLSELECTED which is pretty tough to master.

    Perhaps Greg_Deckler or Anonymouscan explain this.

     

    Thanks and Regards

  • v-lili6-msft's avatar
    v-lili6-msft
    6 years ago

    hi  Anonymous 

    For your case, this formula should work

    Saving Running Total 3 = CALCULATE([Total Savings],
    FILTER(ALLSELECTED('Dates') ,
    'Dates'[Date] <= MAX('Dates'[Date]) ))

     

    or

    TOTALYTD may meet your requirement too

    Saving Running Total 4 = TOTALYTD([Total Savings],Dates[Date])
     
    Regards,
    Lin