Forum Discussion

IDepi22's avatar
IDepi22
Frequent Visitor
4 years ago
Solved

Relative Date Filter based on Second Date

Hello,   I am trying to filter one date off of another. I need to determine how many people were given both rx1 & rx2 in the same month, using rx2_date as a slicer. Here is some sample data:   ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi IDepi22 ,

     

    Please check this measure:

    Measure =
    CALCULATE (
        COUNT ( 'Table'[id] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            YEAR ( 'Table'[rx1_date] ) = YEAR ( 'Table'[rx2_date] )
                && MONTH ( 'Table'[rx1_date] ) = MONTH ( 'Table'[rx2_date] )
        )
    )
    

     

    Best Regards,

    Jay