Forum Discussion

RingoSun's avatar
RingoSun
Helper II
4 years ago
Solved

Dynamic slicer based on another slicer

Let's say I have two slicers. The first slicer consists of Month Names and the other slicer will contain "Weekly", "Monthly", "Yearly".   So if I select only one month in the month names slicer, th...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  RingoSun ,

    Here are the steps you can follow:

    1. Create measure.

    Flag =
    SWITCH(
        TRUE(),
    COUNTROWS(VALUES('Table'[Monthyear]))=1&&SELECTEDVALUE('Table2'[Slicer])="Week",1,
    COUNTROWS(VALUES('Table'[Monthyear]))>=4&& OR( SELECTEDVALUE('Table2'[Slicer])="Month",SELECTEDVALUE('Table2'[Slicer])="Week"),1,
    COUNTROWS(VALUES('Table'[Monthyear]))>=2&&SELECTEDVALUE('Table2'[Slicer])="Month",1,
    0)

    2. Result:

    If you need pbix, please click here.

     

    Best Regards,

    Liu Yang

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