The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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?
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?
Hi @mh20221111
Rather than test for 0 could you test for blank:
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:
Setting it to 10 causes the matrix to appear:
Changing it to 0 the matrix still appears:
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.