Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AnanthanR
Helper I
Helper I

Issue In running Total

Hello Everyone,

 

I am using Power bi Table visual. I tried to create running count on my report but, I am not getting correct value. In my table I have Container, Operation and Timestamp and Duration columns. I needs to create the running total for duration by Container and Operation. but some time the running total getting reset for next operation for same container.

 

AnanthanR_0-1719558573643.png

for next operation its resetting the running count. below is my DAX query. I have rework flag slicer so I have added Reworflag in Dax.

 

Running Total Duration =
VAR CurrentDate = MAX('Report'[Time Stamp])
VAR CurrentContainer = MAX('Report'[Container])
VAR CurrentOperation = MAX('Report'[Operation])
VAR CurrentReworkFlag = MAX('Report'[Rework Flag])

RETURN
CALCULATE(
    SUM('Report'[Duration (Minutes)]),
    FILTER(
        ALL('Report'),
        'Report'[Time stamp] <= CurrentDate &&
        'Report'[Container] = CurrentContainer &&       
        'Report'[Rework Flag] = CurrentReworkFlag
    )
)

 

Thanks,

Ananth

7 REPLIES 7
elitesmitpatel
Super User
Super User

Please share a demo pbix file, and also your output what you want, Thanks

Hi elismitpatel,

 

please find the attached screenshot for my report. I have to calculate the running total for Duration, for each container. I have marked in yellow its not getting correct running total.

AnanthanR_0-1719813025392.png

 

here is Dax quey I have used for running total.

 

Running Total Duration =
VAR CurrentDate = MAX('Report'[Time Stamp])
VAR CurrentContainer = MAX('Report'[Container])
VAR CurrentOperation = MAX('Report'[Operation])
VAR CurrentReworkFlag = MAX('Report'[Rework Flag])

RETURN
CALCULATE(
SUM('Report'[Duration (Minutes)]),
FILTER(
ALL('Report'),
'Report'[Time stamp] <= CurrentDate &&
'Report'[Container] = CurrentContainer &&
'Report'[operation] <= CurrentOperation &&

'Report'[Rework Flag] = CurrentReworkFlag

))

 

Thanks,

Ananth

 

 

 

Hi Elitesmitpatel,

 

Here I am not able to attach the file. Attachment option not available.

 

Thanks,

Ananth

rajendraongole1
Super User
Super User

Hi @AnanthanR - Can you try the below measure , add one more condition with operation 

Measure:

 

Running Total Duration =
VAR CurrentTimestamp = MAX('Report'[Time Stamp])
VAR CurrentContainer = MAX('Report'[Container])
VAR CurrentOperation = MAX('Report'[Operation])
VAR CurrentReworkFlag = MAX('Report'[Rework Flag])

RETURN
CALCULATE(
SUM('Report'[Duration (Minutes)]),
FILTER(
ALL('Report'),
'Report'[Time Stamp] <= CurrentTimestamp &&
'Report'[Container] = CurrentContainer &&
'Report'[Operation] <= CurrentOperation &&
'Report'[Rework Flag] = CurrentReworkFlag
)
)

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thanks Rajendra for your time, I have tired the dax you provided but still i am not getting correct running total. but when i select the values in Rework slicer running count working fine.

 

AnanthanR_0-1719566986483.png

Thanks,

Ananth

Hi @AnanthanR - can you try below one.

Running Total Duration =
VAR CurrentTimestamp = MAX('Report'[Time Stamp])
VAR CurrentContainer = MAX('Report'[Container])
VAR CurrentOperation = MAX('Report'[Operation])
VAR CurrentReworkFlag = MAX('Report'[Rework Flag])

RETURN
CALCULATE(
SUM('Report'[Duration (Minutes)]),
FILTER(
ALL('Report'[Time Stamp], 'Report'[Container], 'Report'[Operation], 'Report'[Rework Flag]),
'Report'[Time Stamp] <= CurrentTimestamp &&
'Report'[Container] = CurrentContainer &&
'Report'[Operation] <= CurrentOperation &&
(ISBLANK(CurrentReworkFlag) || 'Report'[Rework Flag] = CurrentReworkFlag)
)
)

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi Rajendra, 

Still its not working could you please help me on this.

 

Thanks,

Ananth

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.