Forum Discussion

ralfgomezc's avatar
ralfgomezc
New Member
6 years ago

searching acumulate value

Hey I need help with this

 

I got a table

 

KeySequenceStartEndTime
K114:005:0000:20
K115:006:00

00:22

K116:007:00

00:30

K124:005:00

01:30

K125:006:00

01:50

K126:007: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: 

KeySequenceStartEndTime
K114:005:0000: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

KeySequenceStartEndTime
K125:006: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...!!