Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
lisanneAsked
Frequent Visitor

Show two-layered filter only if there are multiple options

Good morning everyone,

I have a question. I'm currently building a dashboard in Power BI, and I've created a two-layered filter for my dashboard. What I would like is for the down arrow to only be displayed for filtering on the second filter if there are more than two options. Does anyone know if this is possible and how I can achieve it?

 

Thanks in advance!


Kind regards,

Lisanne

1 ACCEPTED SOLUTION
johnbasha33
Solution Sage
Solution Sage

@lisanneAsked 

Good morning! It sounds like you want to conditionally show the down arrow in your filter based on the number of options available. While Power BI doesn't have a built-in feature for directly achieving this, you can use a workaround using DAX expressions and buttons to simulate this behavior. Here's how you can do it:

1. **Create a Measure:** Start by creating a measure that calculates the count of options available in your second filter. You can use the DISTINCTCOUNT function to count unique values in a column. For example:

```DAX
OptionCount = DISTINCTCOUNT(Table[Column])
```

Replace `Table` with the name of your table and `Column` with the column containing the filter options.

2. **Create a Button:** Insert a button onto your report canvas from the Visualizations pane. This button will serve as the down arrow for your filter.

3. **Set Button Visibility:** Go to the Format pane for the button. Under the General section, you'll find an option for "Button text." You can use the `OptionCount` measure you created earlier to dynamically control the visibility of the button.

4. **Use DAX to Hide Button:** You can use a DAX expression to control the visibility of the button based on the count of options. Here's an example:

```DAX
ShowButton = IF([OptionCount] > 2, TRUE(), FALSE())
```

This DAX measure will return TRUE if there are more than two options available in your filter, and FALSE otherwise.

5. **Configure Button Actions:** Once you've set up the button visibility, you can configure actions for the button. For example, you can use the "Bookmark" action to navigate to a different page or section of your report where the second filter is located.

By following these steps, you can conditionally show the down arrow button for your second filter based on the number of options available. While it's not a direct feature in Power BI, this workaround should achieve the desired behavior for your dashboard.

Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!

View solution in original post

1 REPLY 1
johnbasha33
Solution Sage
Solution Sage

@lisanneAsked 

Good morning! It sounds like you want to conditionally show the down arrow in your filter based on the number of options available. While Power BI doesn't have a built-in feature for directly achieving this, you can use a workaround using DAX expressions and buttons to simulate this behavior. Here's how you can do it:

1. **Create a Measure:** Start by creating a measure that calculates the count of options available in your second filter. You can use the DISTINCTCOUNT function to count unique values in a column. For example:

```DAX
OptionCount = DISTINCTCOUNT(Table[Column])
```

Replace `Table` with the name of your table and `Column` with the column containing the filter options.

2. **Create a Button:** Insert a button onto your report canvas from the Visualizations pane. This button will serve as the down arrow for your filter.

3. **Set Button Visibility:** Go to the Format pane for the button. Under the General section, you'll find an option for "Button text." You can use the `OptionCount` measure you created earlier to dynamically control the visibility of the button.

4. **Use DAX to Hide Button:** You can use a DAX expression to control the visibility of the button based on the count of options. Here's an example:

```DAX
ShowButton = IF([OptionCount] > 2, TRUE(), FALSE())
```

This DAX measure will return TRUE if there are more than two options available in your filter, and FALSE otherwise.

5. **Configure Button Actions:** Once you've set up the button visibility, you can configure actions for the button. For example, you can use the "Bookmark" action to navigate to a different page or section of your report where the second filter is located.

By following these steps, you can conditionally show the down arrow button for your second filter based on the number of options available. While it's not a direct feature in Power BI, this workaround should achieve the desired behavior for your dashboard.

Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

Top Kudoed Authors