Forum Discussion

AllanBerces's avatar
AllanBerces
Icon for Post Prodigy rankPost Prodigy
2 years ago

Running Total from a measure

Hi Good day,

How to create runing total from a measure. I try the quick measure but it just copy the data, the running total value should be -1 day from current date. (Let say toaday is Feb 27 the value of running total should be up to Feb 26.)  Daily earned is from a measure

Thank you in advance

 

6 Replies

  • Musadev's avatar
    Musadev
    Icon for Resolver III rankResolver III

    Hi AllanBerces 

    I have used a column instead of measure, you need to do mecessary changes for your data.
    Here is the DAX code.

    Running Total = 
    VAR CurrentDate = MAX('tbl2'[date])-1
    RETURN
        CALCULATE(
            SUM(tbl2[Earning]),
            FILTER(
                ALL(tbl2[date]),
                tbl2[date] <= CurrentDate
            )
        )

    Here is the output for my custom data. 

    Good Luck!

     

    • AllanBerces's avatar
      AllanBerces
      Icon for Post Prodigy rankPost Prodigy

      Hi Musadev,

      Thank you for your reply, but cant add column on my table. 

       

      Thank you

       

      • Musadev's avatar
        Musadev
        Icon for Resolver III rankResolver III

        Are you missing some records or not able to map them with your data?
        If you have similar table data and columns as shared in the query, i will update my data and will share it with you.