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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
mh20221111
Advocate I
Advocate I

What-If Parameter and Matrix Visibility Based on User Input

I'm trying to control the visibility of a matrix visual in Power BI based on a numeric What-If parameter. The goal is:


・When the parameter is blank (i.e., no user input), the matrix should be completely hidden (including rows and columns).
・When the user inputs a value (including 0), the matrix should display data accordingly.

I created a measure like this to control visibility:

ShowDataFlag =
VAR SelectedValue = 'InputValue'[InputValue]
RETURN
IF(SelectedValue >= 0, 1, 0)


Then I applied this measure as a visual-level filter (ShowDataFlag = 1) on the matrix.

Here’s the issue:

・If the parameter is blank and the user inputs 0, the matrix remains hidden.
・If the user first inputs a value like 10, and then changes it to 0, the matrix displays correctly.

It seems that Power BI doesn’t recognize the selection of 0 as a valid input when coming from a blank state. I also tried using HASONEVALUE() and ISBLANK() in various combinations, but the behavior persists.

Is there a reliable way to detect when the user has explicitly selected or entered 0 in a What-If parameter, even if the initial state was blank?

7 REPLIES 7
v-pgoloju
Community Support
Community Support

Hi @mh20221111,

 

Thank you for reaching out to the Microsoft Fabric Forum Community, and special thanks to @SamWiseOwl  for prompt and helpful response.

 

Just following up to see if the response provided by community member were helpful in addressing the issue.

If one of the responses helped resolve your query, please consider marking it as the Accepted Solution. Feel free to reach out if you need any further clarification or assistance.

 

Best regards,
Prasanna Kumar

I received one response, but it did not meet the requirements.
Is the fact that Power BI does not recognize 0 as a valid input when coming from a blank state a limitation of its specifications?

SamWiseOwl
Super User
Super User

Hi @mh20221111 
Rather than test for 0 could you test for blank:

ShowDataFlag =
VAR SelectedValue = InputValue[InputValue Value]
RETURN
IF(not(ISBLANK( SelectedValue)), 1, 0)
SamWiseOwl_0-1754562362802.png

Feel free to modify test file to match yours more.


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

I appreciate your help! I tried the measures and the uploaded file, but unfortunately, they didn't quite meet my requirements. Thank you so much for your assistance!

How does it differ? Feel free to provide your own file with the error described 🙂


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

I would like the default state to be such that when the user hasn't entered anything, nothing is displayed on the screen matrix. Although users often input 0 initially, I prefer not to have 0 as the default entry.

※Sorry, I made a correction to part of the text.

Sorry I am not understanding.

The default when the slicer is cleared has the matrix empty:

SamWiseOwl_0-1755070097798.png

Setting it to 10 causes the matrix to appear:

SamWiseOwl_1-1755070121977.png

Changing it to 0 the matrix still appears:

SamWiseOwl_2-1755070144039.png

 

 


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors