Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I have a table where every person has a record for every day of the year. I used the following function to achieve a running total based on the daily balance column
Hi @LCarr ,
You could try to use below expressions:
If you want to use column, you could try below
Column = CALCULATE(
SUM(Leave[Balance]),
FILTER(
ALLEXCEPT(Leave, Leave[Id]),Leave[type]=EARLIER(Leave[type])&&
Leave[Date] <= EARLIER(Leave[Date])
))
If you want to use measure , you could try below
Measure = CALCULATE(
SUM(Leave[Balance]),
FILTER(
ALLEXCEPT(Leave, Leave[Id],Leave[type]),
Leave[Date] <= MIN(Leave[Date])
))
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks, the column is close but I didn't manage to fully explain the issue (sorry first time poster). I can post a different question if that is more appropriate but I am still looking to get the running total to restart, just with different criteria.
The criteria is
If Type = Working and the running total of Daily Balance is less than zero AND the Type of the previous row is not equal to Working then restart the running total from 1.
Many Thanks
Lynsey
Hi @LCarr
I am sorry for late reply , you could try to add an index column in table by M code, then use measure to achieve this goal. You could refer to my sample for details.
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
103 | |
87 | |
77 | |
70 | |
69 |
User | Count |
---|---|
113 | |
99 | |
97 | |
72 | |
68 |