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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
Super User
Super User

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
Super User
Super User

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.