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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
roncruiser
Post Patron
Post Patron

Card for Slicer Selection

Hi,
I'd like to see within a card a comment based on selection of the slicer.
I'm not sure how go about this.

This is the slicer:
Screenshot 2023-03-28 122631.jpg
If "Selected All" or none selected then "All".
If all 0-7 in green selected then "Sub".
If only 220 selected then "High".
If there are random selections then "Multiple".

This will be for a title of a chart.  I'm working with selectedvalue but with no success so far.  Still going at it.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

 

this should do the trick:

 

Switch(
    TRUE(),
    DISTINCTCOUNT('Table'[column]) = CALCULATE(countrows('Table'), ALL('Table')), "All",
    DISTINCTCOUNT('Table'[column])>1 ||  DISTINCTCOUNT('Table'[ct]) > CALCULATE(countrows('Table'), ALL('Table')) -1, "Multiple",
    VALUE(Selectedvalue('Table'[column]))*1 <= 7, "Sub",
    VALUE(Selectedvalue('Table'[column]))*1  =220, "High"
)
 
Regards,
Max

View solution in original post

7 REPLIES 7
roncruiser
Post Patron
Post Patron

I likely was not clear with the card expectations.
@amitchandak 
@Anonymous 

Here's a better example:

Slicer settings:

roncruiser_0-1680528141866.png if none selected.  Card reads "none".

roncruiser_1-1680528213374.png if all selected. Card reads "All".

roncruiser_2-1680528267624.png if all selected as shown. Meaning all of 0-1-2-3-4-5-6-7 are selected at the same time. Card reads "Sub".

roncruiser_3-1680528401464.png if only "220" is selected as shown. Card reads "High".

Thanks for the attemped solutions, but none of them met the criteria or did something entirely different than intended.

I tried to play around and modify the solutions but still could not get them to work.
Still seeking help please.




 




 




roncruiser
Post Patron
Post Patron

@Anonymous 

I commented out the line for "Multiple".  I still do not know what [ct] mean.  Until that is clear, I can leave that out.
As you can see, even when nothing is selected "All" does show up in the card.
Along the same lines, selecting 0-7, "Sub" does not show either on the card.

I'll play with your expression to see if I can get it to go.

roncruiser_0-1680218366452.png


Thanks for the response.
Any further help is appreciated!

Anonymous
Not applicable

Hi,

 

this should do the trick:

 

Switch(
    TRUE(),
    DISTINCTCOUNT('Table'[column]) = CALCULATE(countrows('Table'), ALL('Table')), "All",
    DISTINCTCOUNT('Table'[column])>1 ||  DISTINCTCOUNT('Table'[ct]) > CALCULATE(countrows('Table'), ALL('Table')) -1, "Multiple",
    VALUE(Selectedvalue('Table'[column]))*1 <= 7, "Sub",
    VALUE(Selectedvalue('Table'[column]))*1  =220, "High"
)
 
Regards,
Max

Thank you Anonymous Max.  I revisted this and was able to implement your measure.

 

@Anonymous 

Hi Max,

I do not know what [ct] means with respect to the expression.  I do not have a column "ct" in my table.
Should I use an use an explicit measure to get count?  Does ct = count?

Thanks.
Ron

roncruiser_0-1680215990795.png

 

amitchandak
Super User
Super User

@roncruiser ,

Switch(

isblank( Selectedvalue(Table[Column])) , "All",

Selectedvalue(Table[Column]) *1 <=7, "Sub"

Selectedvalue(Table[Column]) *1 =220, "High"

//add other conditions

)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

Thank You for the reply.

Maybe there is somethings I am missing as it is not working for me.  I created the measure and 
dropped it into a card and choose the slicer settings but get the following....

Not sure what I am doing wrong.

roncruiser_0-1680208283227.png

 



 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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