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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Check if certain value is selected in slicer

Hi All, in the Country slicer I have, I want to check if Singapore is selected. How should I find that by using calculated measures?

 

Regards,

BK

1 ACCEPTED SOLUTION

Hi, @Anonymous 

Thank you for your feedback.

The reason is that because my sample does not have Select All in the slicer. So I added a condition hasonevalue in my measure. If I do not add this condition into my sample, and if I do not select anything, then the result will be still "Selected" in my sample.

If your sample has Select All in the slicer, then please consider what happens if you do not select anything. In your sample, I assume, not selecting anything means the same thing as select all.

If the above assumption is correct, then you can simply delete the hasonevalue condition, like below.

 

Singapore Select or not =
IF ( "Singapore" IN ALLSELECTED ( 'Table'[Country] ),
"Selected",
"Not Selected"
)
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

I am not sure what is your desired outcome, but I assume you want to see it in the card visualization.

Please check the below picture and the sample pbix file's link down below.

 

Picture5.png

 

Singapore Select or not =
IF (
HASONEVALUE ( 'Table'[Country] )
&& "Singapore" IN ALLSELECTED ( 'Table'[Country] ),
"Selected",
"Not Selected"
)
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Hi @Jihwan_Kim , thanks for the reply. When I change to Select All in the slicer, the measure will display "Not Selected" instead

 

Regards,

BK

Hi, @Anonymous 

Thank you for your feedback.

The reason is that because my sample does not have Select All in the slicer. So I added a condition hasonevalue in my measure. If I do not add this condition into my sample, and if I do not select anything, then the result will be still "Selected" in my sample.

If your sample has Select All in the slicer, then please consider what happens if you do not select anything. In your sample, I assume, not selecting anything means the same thing as select all.

If the above assumption is correct, then you can simply delete the hasonevalue condition, like below.

 

Singapore Select or not =
IF ( "Singapore" IN ALLSELECTED ( 'Table'[Country] ),
"Selected",
"Not Selected"
)
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

this doesn't work, this is stupid, no matter which value you have selected it returns true. This is not a solution.

 

The solution is IF("Singapore" IN VALUES('Table'[Country]), "SELECTED", "NOT SELECTED")

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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