Forum Discussion

PBI5851's avatar
PBI5851
Helper V
4 years ago
Solved

Rolling counts-ish

hello, with the below data, i am trying to count how many unique items per month/quarter were open (i.e they must fall between orderdate and maxorderdate)   PriMKey ItemID OrderDate MaxOrder...
  • Jihwan_Kim's avatar
    4 years ago

    Hi,

    Please check the below picture and the attached pbix file.

     

     

    Unique count item: =
    CALCULATE (
    DISTINCTCOUNT ( Data[ItemID] ),
    FILTER (
    Data,
    MAX ( 'Calendar'[Date] ) >= Data[OrderDate]
    && MIN ( 'Calendar'[Date] ) <= Data[MaxOrderdate]
    )
    )