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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Showing hiding visuals using DAX?

Hi everyone,

 

Currently I am facing the following scenario/problem:

 

When a product is available (using the text filter function), I would like to show the number of that product that is available using a bar chart:

product available.png

However, when a product is not available (i.e., count product = 0), I would like to show a text message (instead of the bar chart):

 

product not available.png

Anyone have an idea how to implement this? I guess I have to use some DAX formula here, but am not sure how. 

 

Thanks in advance!

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @Anonymous ,

I don't think that completely hiding a visual is currently supported but there is a work around to make it appear so.
I would create a measure that will return a text string if the value of another measure is blank(). Something like:

ErrorMeasure =
IF (
    [TestMeasure] = BLANK (),
    "This product is no longer available. Please select something else.",
    ""
)


I'd place this error measure in a single row card,  disable the category label and position it at the back of the bar chart. The bar chart should not have a background/transparent.

danextian_0-1648294253639.png

danextian_1-1648294487235.png

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
danextian
Super User
Super User

Hi @Anonymous ,

I don't think that completely hiding a visual is currently supported but there is a work around to make it appear so.
I would create a measure that will return a text string if the value of another measure is blank(). Something like:

ErrorMeasure =
IF (
    [TestMeasure] = BLANK (),
    "This product is no longer available. Please select something else.",
    ""
)


I'd place this error measure in a single row card,  disable the category label and position it at the back of the bar chart. The bar chart should not have a background/transparent.

danextian_0-1648294253639.png

danextian_1-1648294487235.png

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

Thanks so much - this was exactly what I was looking for!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors