Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Running total till current week

Hi All,

 

I have a sitution where I have created a quick measure for the running total but the measure is running for the entire weeks of the quarter. 

 

Is there a way I can filter that the measure runs only till today or the current week instead of the entire duration of the quarter?

 

Regards

 

10 Replies

  • Anonymous ,

    try like

     

    Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date]) && 'Date'[date]<= today()  ))

    Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=max(date[Date]) && 'Date'[date]<= today() ))

     

    or

     

    Cumm Sales = if(max('Date'[date]) <= today(), blank(), CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=max(date[Date]))) )

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak The calculation is running for each week but when going to the next week i want the previous number added to that week to make it a running total. Like in the below screenshot the first week shows SQO Running number to be 499 and in next week its showing 5. Instead of 5 it should show 499+5 = 504.

       

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Greg_Deckler Ahmedx any help here as needs to resolve this urgently.

     

    I have tried using few other measures like the below but still didn't find the solution yet.

     

    Measures Tried:

     

    SQO Running =

    CALCULATE([SQO Count],filter(all(F_PIPEGEN[FULL_DATE]),F_PIPEGEN[FULL_DATE] <=max(F_PIPEGEN[FULL_DATE]) && F_PIPEGEN[FULL_DATE]<= today() ))

     

    SQO Running = 

    IF(
    [SQO Count] <> BLANK(),
    CALCULATE(
    [SQO Count],
    FILTER(
    ALL(F_PIPEGEN[FULL_DATE]),
    F_PIPEGEN[FULL_DATE] <= MAX(F_PIPEGEN[FULL_DATE])
    )
    )
    )

  • plse try this

    SQO Running =
    VAR _today =  TODAY()
    VAR _EndWeek = _today-WEEKDAY(_today,2) +7
    CALCULATE([SQO Count],
    filter(All(F_PIPEGEN[FULL_DATE]),
               F_PIPEGEN[FULL_DATE] <=_EndWeek))
    
    
    - - - -
    SQO Running =
    VAR _today =  TODAY()
    CALCULATE([SQO Count],
    filter(All(F_PIPEGEN[FULL_DATE]),
               F_PIPEGEN[FULL_DATE] <=_today))
    • Anonymous's avatar
      Anonymous
      Not applicable

      No luck, It gives be number for that week but I want the running total number.

      The next week should have numbers from the previous week also.

       

       

      • Ahmedx's avatar
        Ahmedx
        Super User

        can you explain normally what period you need