Power BI calculate DAX measure cumulatively

Power BI calculate DAX measure cumulatively

Problem Description:

I can’t configure how to calculate DAX measure cumulatively. The DAX measure by it self looks like this:

UpdateTicket_ = CALCULATE(Logging[LogDistcount_], Logging[Step] = 7) # DAX measure to filter distinct ID by some condition.

LogDistcount_ = DISTINCTCOUNT(Logging[TicketId]) # DAX measure to calculate distinct ID presented in the featured dataset.

The ploblem is that formula construction to calculate cumulatively doesn’t allow to sum DAX measure. I mean this: =CALCULATE(SUM(UpdateTicket_)… The formula doesn’t give an option to select UpdateTicket_ to make a SUM of it. This measure doesn’t appear in the selection list of the SUM formula at all.

Currently output of the UpdateTicket_ measure looks like this:

StartTime_DateOnlyUpdateTicket_
08.11.2022950
09.11.20221056
10.11.20221056
11.11.20221056
12.11.20221056
13.11.20221056

What I am looking for:

StartTime_DateOnlyUpdateTicket_UpdateTicket_Cumulatively
08.11.2022950950
09.11.202210562006
10.11.202210563062
11.11.202210564118
12.11.202210565174
13.11.202210566230

Solution – 1

I hope you can accept the following solution:

Let Power BI create the measure for you by going to Quick measureRunning total

enter image description here

You’ll get the following expression:

UpdateTicket_Cumulatively = 
CALCULATE(
    SUM('Table'[UpdateTicket_]),
    FILTER(
        ALLSELECTED('Table'[StartTime_DateOnly]),
        ISONORAFTER('Table'[StartTime_DateOnly], MAX('Table'[StartTime_DateOnly]), DESC)
    )

and a table like this:

enter image description here

Note that this works with both measures and columns.

Rate this post
We use cookies in order to give you the best possible experience on our website. By continuing to use this site, you agree to our use of cookies.
Accept
Reject