Forum Discussion
cumulative count within DAX table variable
Hi scotjn1 ,
Create TEMP as a calculated table and then add this column. But the results still seem to be problematic. Can you further explain the judgment condition between type1 and type2, so that I can do further testing.
Looking forward to your feedback.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- scotjn14 years agoHelper I
Hi v-henryk-mstf ,
This is getting very close. The count of 17 is correct in your screenshot. Since I only care about the count where Type1 = 1, the intermediate steps are irrelevant so it's OK that they all show the final count of 17 instead of the increments in my original post.
The next step to solve is that the count should "reset" each time Type1 = 1, so in cases where a given SampleID has multiple records where Type1 = 1 the incremental counter would be this:
Here is a SampleID where some of the counts would be zero:
Thank you for solving the first step!
Jacob