Forum Discussion

obriaincian's avatar
obriaincian
Icon for Resolver I rankResolver I
4 years ago
Solved

DATESINPERIOD not working

Hi All,   I have a Power BI Dashboard where I want to count the number of distinct dates in the Expiry column but I also want to filter the Date column to display rows that are within the last 3 mo...
  • v-jingzhang's avatar
    v-jingzhang
    4 years ago

    Hi obriaincian 

     

    Try this measure

    last3Months 2 = 
    CALCULATE (
        DISTINCTCOUNT ( 'Data2'[Expiry Date] ),
        'Data2'[Expiry Date] <> BLANK (),
        'Data2'[Date] > EOMONTH(MAX(Data2[Date]),-3)
    )-1

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.