Power BI cumulative count with DAX

496 Views Asked by At

Here is a table of two rows:

ItemID Date1 Date2 Category
1 2019-03-18 2020-07-31 A
1 2020-10-18 2020-07-31 A

Cumulatively count the number of unique items by category where Date1 >= Date2

I created a measure (thanks @jprzd) for a column chart:

Measure = CALCULATE(DISTINCTCOUNT(Table[ItemID]),FILTER(ALLSELECTED(Table),Table[Date1]>=Table[Date2]))

It does not result in the correct cumulative count. I think the above DAX expression is likely in the right direction, but I couldn't figure out where it went wrong.

I'd greatly appreciate your help.

0

There are 0 best solutions below