Forum Discussion
Anonymous
4 years agoNot applicable
Running Total Required
Hi All I have data below I need Running Total of VarFlag for Employee, Date, Day , kindly help
Anonymous
4 years agoNot applicable
Hi Anonymous ,
Please have a try.
Create a flag column.
flag =
IF ( 'Table'[START TIME] = "D/O", 0, 1 )
Then create a column group the date.
minflagdate =
CALCULATE (
MIN ( 'Table'[date] ),
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[date] >= EARLIER ( 'Table'[date] )
&& 'Table'[flag] = 0
)
)
Then create a measure to get the answer.
result =
VAR _1 =
CALCULATE (
SUM ( 'Table'[flag] ),
FILTER (
ALL ( 'Table' ),
'Table'[date] <= SELECTEDVALUE ( 'Table'[date] )
&& 'Table'[minflagdate] = SELECTEDVALUE ( 'Table'[minflagdate] )
&& 'Table'[EMPLY ID] = SELECTEDVALUE ( 'Table'[EMPLY ID] )
&& 'Table'[Employee name] = SELECTEDVALUE ( 'Table'[Employee name] )
)
)
RETURN
IF ( MAX ( 'Table'[flag] ) = 0, 0, _1 )
If I have misunderstood your meaning, please provide more details with your desired output.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.