cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Helper II

## 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, the other slicer should only show me the Weekly option

And if I have 4 months selected in the months slicer then the other slicer should show Weekly and Monthly

That's basically the whole idea, is something like this actually possible in Power bi?

1 ACCEPTED SOLUTION
Community Support

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:

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

3 REPLIES 3
Community Support

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:

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

Community Support

Hi  @RingoSun ,

I created some data:

Table：

Table2：

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]))>=2&&SELECTEDVALUE('Table2'[Slicer])="Month",1,
0)

2. Place [Flag]in Filters, set is=1, apply filter.

3. Result:

Choose one：

Choose four:

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

Helper II

Hi there, what changes can I make here to make it so that if I have four months selected, it would show both Week and Month

Announcements

#### Fabric certifications survey

Certification feedback opportunity for the community.

#### Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

#### Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors