Forum Discussion

FawadRehman's avatar
FawadRehman
Helper I
10 years ago
Solved

Running Total - DAX

I need help. I am looking for same solution http://community.powerbi.com/t5/Desktop/DAX-Running-total-by-another-column/m-p/10512#M2189 but somehow its not working for me. 

 

RunningTotal =
CALCULATE (
SUM ( TabelForecast[Forcast] );
FILTER ( ALL ( TabelForecast ); TabelForecast[MonthYear] <= MAX ( TabelForecast[MonthYear] ) );
VALUES ( TabelForecast[M#] )
)

 

 

I have tried many formulas in power BI but its not giving me running total but total for all the rows Smiley Sad Any suggestions?

  • Sean's avatar
    Sean
    10 years ago

    FawadRehman This should work... Let me know.

     

    Running Total COLUMN =
    CALCULATE (
        SUM ( TabelForecast[Forecast] ),
        ALLEXCEPT ( TabelForecast, TabelForecast[M#] ),
        TabelForecast[MonthYear] <= EARLIER ( TabelForecast[MonthYear] )
    )

14 Replies

  • Sean's avatar
    Sean
    Community Champion

    FawadRehman This formula is for a MEASURE not a Calculated Column

     

    see post you are referencing => it is used in a PIVOT TABLE

     

    EDIT:

    • kcantor's avatar
      kcantor
      Community Champion

      FawadRehman I believe you have to create a table to make that work. Beyond my meger skill set but Sean can help you with this.

    • FawadRehman's avatar
      FawadRehman
      Helper I

      Sean Thank you, this is great. But at the same time, i have this in table,then i make a outer left join this table to another table to insert my running my Running total column values. I am very new in Power BI so please excuse my stupid logic or questions.  Thanks

      • Sean's avatar
        Sean
        Community Champion

        Can you provide a sample of the desired final result? Are you doing a summary table?