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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
ximenarasu
New Member

Can’t apply filter to measure in visual filter pane (grayed out / locked)

Hi everyone,
I’m trying to apply a filter to a DAX measure in the “Filters on this visual” pane, but the filter option appears completely grayed out, like it’s disabled. I can’t change the filter type (e.g., from “is less than” to “is”) or enter any values.

The measure returns 1 or 0 depending on whether a slicer contains a specific value. My goal is to show or hide a visual based on this condition. I even tried modifying the measure to return text (“Show” / “Hide”), but it still doesn’t work.

I’ve already tried:

  • Adding the measure directly to the visual.

  • Creating a new measure with a different name.

  • Restarting Power BI.

  • Using the page-level filter pane instead of visual-level.

Has anyone faced this issue or knows how to unlock the filter on a measure?

Thanks a lot!


PowerBI Issue.png

1 ACCEPTED SOLUTION
v-pnaroju-msft
Community Support
Community Support

Thankyou, @MasonMA@lbendlin, for your response.

Hi ximenarasu,

We appreciate your question on the Microsoft Fabric Community Forum.

We understand that you are trying to apply a filter on a DAX measure in the “Filters on this visual” pane, but it is greyed out or disabled. This happens because Power BI does not allow filtering visuals directly using DAX measures. Measures calculate values on the fly and do not store fixed values like columns do.

Since you want to show or hide a visual when selecting something from a slicer (for example, when "Product A" is selected), here is a simple way to do it using a calculated column and visual-level filters.

Please follow these steps:

  1. Create a new calculated column in your table:
    IsProductA = IF(SalesData[Product] = "Product A", 1, 0)
  2. Add a slicer using the Product field to select a product.
  3. Make a bar chart with Product on the axis and Sales as values.
  4. In the bar chart, go to the Filters on this visual pane, drag the new IsProductA column there, and set the filter to IsProductA is 1.

This will make the chart show data only when "Product A" is selected. Otherwise, the chart will be hidden.

You can also create a measure:
ShowMessage =
IF(SELECTEDVALUE(SalesData[Product]) <> "Product A", "Please select Product A to view chart", BLANK())
Add this measure to a Card visual to display a message when the chart is hidden.

We have attached a screenshot and a sample pbix file for your reference:

vpnarojumsft_0-1751010806090.png

vpnarojumsft_1-1751010837595.png

If this helps you, please mark the response as the accepted solution and give kudos. This will help others with similar questions.

If you have more doubts, please feel free to ask the Microsoft Fabric community.

Thank you.

View solution in original post

6 REPLIES 6
v-pnaroju-msft
Community Support
Community Support

Thankyou, @MasonMA@lbendlin, for your response.

Hi ximenarasu,

We appreciate your question on the Microsoft Fabric Community Forum.

We understand that you are trying to apply a filter on a DAX measure in the “Filters on this visual” pane, but it is greyed out or disabled. This happens because Power BI does not allow filtering visuals directly using DAX measures. Measures calculate values on the fly and do not store fixed values like columns do.

Since you want to show or hide a visual when selecting something from a slicer (for example, when "Product A" is selected), here is a simple way to do it using a calculated column and visual-level filters.

Please follow these steps:

  1. Create a new calculated column in your table:
    IsProductA = IF(SalesData[Product] = "Product A", 1, 0)
  2. Add a slicer using the Product field to select a product.
  3. Make a bar chart with Product on the axis and Sales as values.
  4. In the bar chart, go to the Filters on this visual pane, drag the new IsProductA column there, and set the filter to IsProductA is 1.

This will make the chart show data only when "Product A" is selected. Otherwise, the chart will be hidden.

You can also create a measure:
ShowMessage =
IF(SELECTEDVALUE(SalesData[Product]) <> "Product A", "Please select Product A to view chart", BLANK())
Add this measure to a Card visual to display a message when the chart is hidden.

We have attached a screenshot and a sample pbix file for your reference:

vpnarojumsft_0-1751010806090.png

vpnarojumsft_1-1751010837595.png

If this helps you, please mark the response as the accepted solution and give kudos. This will help others with similar questions.

If you have more doubts, please feel free to ask the Microsoft Fabric community.

Thank you.

Hi! @MasonMA @lbendlin @v-pnaroju-msft 

Thank you so much for your detailed explanation and help. I understand now why measures can't be used directly as filters on visuals, and your solution makes perfect sense for bar charts.

However, I’m trying to apply this logic to a gauge chart (used as a thermometer to show task completion rate). The problem is that, when the slicer filters out the "Completed" tasks, the gauge still appears, but shows 0% and doesn't disappear. The title and gauge remain visible, which is misleading.

What I want to achieve is this:
If “Completed” tasks are selected → show the gauge with the completion rate
If “Completed” is not selected → hide the gauge and show a bar chart instead, comparing “Not Started” and “In Progress” tasks.

My idea was to overlay both visuals and use a conditional field to toggle visibility based on the slicer selection, but as shown in the attached screenshots, that doesn’t work well with the gauge.

Is there a workaround or best practice for switching between visuals based on slicer values, especially when working with gauge charts?

Thanks again for your help! 🙌
(I’ve attached a screenshot of what the gauge looks like when "Completed" is not selected.)

PowerBI Issue 2.png

There is no programmatic way to hide/show visuals. Best you can do is mess with the transparency settings of the visual background, but then you lose interactivity for the visual at the back of the z order.

 

If this is important to you please consider voting for an existing idea or raising a new one at https://ideas.fabric.microsoft.com

Correct, values from field can be used as visual-level filter, but i'm not 100% sure this would be a workaround unless user can share a sample file so we can validate the solution, like @lbendlin mentioned, because it sounds like @ximenarasu would prefer to link a measure that returns 1 or 0 with visual control. 

Anyways, please share the feedback so we can learn together:)  

lbendlin
Super User
Super User

please provide more details about your scenario. Measures as filters cannot return boolean, for example. 

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

MasonMA
Resolver III
Resolver III

Hi, i don't think measures can be used as visual-level filters directly in the "Filters on this visual" pane unless they return a scalar value AND the visual context allows evaluation.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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