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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

DAX - Hide message card when any value is nos filtered

Hi, 

I have a dax measure to show an specific message on card when I have Blank values in manufacturer column inside the table,
But when a Filter nothing or I select two or more values without Blank value  this message shows on card but i Want to show nothing for this case.

My dax: 

 

IF (
    SELECTEDVALUE ( Merge1[Manufacturer] ) = BLANK (),
    "Não há correlação de máquinas",""
 
)


1- when a Filter nothing. Want to show nothing message for this case.

lucas_1870_1-1674128690008.png

 

2- It's ok for one value with manufacturer no blank

lucas_1870_3-1674128830799.png

 


3 - I select two or more values without Blank value  this message shows on card but i Want to show nothing for this case.

lucas_1870_4-1674128981127.png

 


Someone could help me with that?

Thank you



 

2 ACCEPTED SOLUTIONS
PowerBIEnthu
Resolver I
Resolver I

Add one more condition like below in your if else statement

 CALCULATE(
        INT ( NOT ( ISEMPTY( Manufaturer) ) ),
        TREATAS ( 
            VALUES ( Merge1[Manufaturer] ), 
            Merge1[Slicer] 
        )
    )>1

  then "Your Condition"

View solution in original post

bolfri
Solution Sage
Solution Sage

I think this DAX code solve your problem. You should put the messages that you want in each scenario.

 

DAX = 
    SWITCH(TRUE(),
        NOT(ISFILTERED(Merge1[Manufaturer])),"Nothing filtered",
        HASONEVALUE(Merge1[Manufaturer]), "One manufacturer",
        NOT(HASONEVALUE(Merge1[Manufaturer])), "Multiple values"
)

 

 

Scenario 1:

bolfri_0-1674206377621.png

 

Scenario 2:

bolfri_1-1674206430559.png

 

Scenario 3:

bolfri_2-1674206445984.png

 

 





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
bolfri
Solution Sage
Solution Sage

I think this DAX code solve your problem. You should put the messages that you want in each scenario.

 

DAX = 
    SWITCH(TRUE(),
        NOT(ISFILTERED(Merge1[Manufaturer])),"Nothing filtered",
        HASONEVALUE(Merge1[Manufaturer]), "One manufacturer",
        NOT(HASONEVALUE(Merge1[Manufaturer])), "Multiple values"
)

 

 

Scenario 1:

bolfri_0-1674206377621.png

 

Scenario 2:

bolfri_1-1674206430559.png

 

Scenario 3:

bolfri_2-1674206445984.png

 

 





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

Proud to be a Super User!




PowerBIEnthu
Resolver I
Resolver I

Add one more condition like below in your if else statement

 CALCULATE(
        INT ( NOT ( ISEMPTY( Manufaturer) ) ),
        TREATAS ( 
            VALUES ( Merge1[Manufaturer] ), 
            Merge1[Slicer] 
        )
    )>1

  then "Your Condition"

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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