Forum Discussion
searching acumulate value
Hey I need help with this
I got a table
| Key | Sequence | Start | End | Time |
| K1 | 1 | 4:00 | 5:00 | 00:20 |
| K1 | 1 | 5:00 | 6:00 | 00:22 |
| K1 | 1 | 6:00 | 7:00 | 00:30 |
| K1 | 2 | 4:00 | 5:00 | 01:30 |
| K1 | 2 | 5:00 | 6:00 | 01:50 |
| K1 | 2 | 6:00 | 7:00 | 03:00 |
| K2 | . | . | . | . |
| K2 | . | . | . | . |
| K2 | . | . | . | . |
| K2 | . | . | . | . |
| K2 | . | . | . | . |
I need the accumulate time for instance. the value to searching for key "K1" is "04:45" I need to sum for each until the max sequence, and the expected result, must be:
First step the value "04:45" is in the next row:
| Key | Sequence | Start | End | Time |
| K1 | 1 | 4:00 | 5:00 | 00:20 |
the result is "04:45" + "00:20" = "05:05"
after that, the new value to search is "05:05" and the second step is
| Key | Sequence | Start | End | Time |
| K1 | 2 | 5:00 | 6:00 | 01:50 |
the result is "05:05" + "01:50" = "06:55"
Final result 06:55
and if the key has more values for sequence, it must to continue until the max value of sequence.
normally this problem it's solved with a loop and auxiliary variables, but I don't know how to solve this problem with DAX.
Please your help with this prblem Thanks...!!
1 Reply
- amitchandakSuper User
ralfgomezc , Refer if this can help
https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389
Convert to second/ Min first and sum and convert back
In Min = hour([Time])*60 + minute([Time])