Forum Discussion
Counting consecutive values
- 6 years ago
Hi davidgaribaldi,
You could try below measure to see whether it work or not
Measure 3 = VAR temp = CALCULATE ( COUNT ( t5[ID] ), FILTER ( ALLEXCEPT ( t5, t5[ID], t5[ Value] ), t5[ Date] <= MIN ( t5[ Date] ) ) ) RETURN IF ( CALCULATE ( COUNT ( t5[ Value] ), ALLEXCEPT ( t5, t5[ID], t5[ Value] ) ) > 1 && temp = 1, 0, temp )Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
For Example, 1, 1/2/2019, A, 2 (this should be 1, as the previous same row started it's count from 0)
Because I only want the end number so I don't want it to increment I just want 0's and the last number in the chain with the amount of that value. I'd gladly settle for something like 1, 1/1/19, A, 2; 1, 1/2/19, A, 2
Basically I want to be able to tell the amount of 'A's' and 'P's' in each chain quickly.
If you can think of a more elegant way to accomplish this I'm open to it.
- dax6 years agoCommunity Support
Hi davidgaribaldi,
You could try below measure to see whether it work or not
Measure 3 = VAR temp = CALCULATE ( COUNT ( t5[ID] ), FILTER ( ALLEXCEPT ( t5, t5[ID], t5[ Value] ), t5[ Date] <= MIN ( t5[ Date] ) ) ) RETURN IF ( CALCULATE ( COUNT ( t5[ Value] ), ALLEXCEPT ( t5, t5[ID], t5[ Value] ) ) > 1 && temp = 1, 0, temp )Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.