Forum Discussion

Jos13's avatar
Jos13
Icon for Helper III rankHelper III
6 years ago
Solved

Previous Month

Hi Team, I have the following measure to get year month (YYYYMM) number for the value selected in the date filter. Current Year Month = SELECTEDVALUE('Date'[YM no]) I used the following measure t...
  • v-lid-msft's avatar
    6 years ago

    Hi Jos13 ,

     

    We can try to use the following measure to meet your requirement:

     

    Prev Year Month =
    VAR CYM =
        MIN ( 'Date'[YM no] )
    RETURN
        CALCULATE (
            MAX ( 'Date'[YM no] ),
            FILTER (
                ALL ( 'Date' ),
                'Date'[YM no] < CYM
            )
        )

     


    Best regards,