Forum Discussion
Running count with multiple conditions
- 5 years ago
Hi rhys1987
You need to first add an index column to the table to indicate precedence. Otherwise there is no way to differentiate those rows in your count. You can do that easily in PQ. Then your calculated column:
Col = CALCULATE ( COUNT ( Table1[Product] ), ALLEXCEPT ( Table1, Table1[Product], Table1[Customer] ), Table1[Index] <= EARLIER ( Table1[Index] ) )Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Hi rhys1987
You need to first add an index column to the table to indicate precedence. Otherwise there is no way to differentiate those rows in your count. You can do that easily in PQ. Then your calculated column:
Col =
CALCULATE (
COUNT ( Table1[Product] ),
ALLEXCEPT ( Table1, Table1[Product], Table1[Customer] ),
Table1[Index] <= EARLIER ( Table1[Index] )
)
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers