Forum Discussion

Balhemkan's avatar
Balhemkan
Icon for Helper III rankHelper III
5 years ago
Solved

Current year and previous year multi selection

      Hello Team,   I have Data table(image).   I have created two measure for Current Year and Previous Year which is working fine.   I am using separate year slicer and separat...
  • v-xulin-mstf's avatar
    5 years ago

    Hi Balhemkan

     

    Check if this is what you want:

    You can create a dimtable and apply to Year slicer.

    Try measures as:

    Current_Year = 
    CALCULATE(
        SUM('Table'[salesamount]),
        FILTER(
        ('Table'),
        'Table'[Year]=MAX('Year Slicer'[Year])
    ))
    Previous_Year = 
    CALCULATE(
        SUM('Table'[salesamount]),
        FILTER(
        'Table',
        'Table'[Year]=MAX('Year Slicer'[Year])-1
    ))

    The pbix is attached.

     

    Best Regards,
    Link

     

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.