March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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.
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.
Thanks,
Ananth
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.
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
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!!
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.
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!!
Proud to be a Super User! | |
Hi Rajendra,
Still its not working could you please help me on this.
Thanks,
Ananth
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
132 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
203 | |
141 | |
107 | |
73 | |
70 |