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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

display text in card based on slicer selection

Hi all,

I have single table with 3 columns

 

i took these three columns in slicer. please see attached image.imageimage

now if i select in slicer then the respective name should display in card.

 

For ex: if i select subhani then the card should display subhani

           if i select katrajthen the card should display katraj           

           if no selection then display "organization"

1 ACCEPTED SOLUTION
v-xulin-mstf
Community Support
Community Support

Hi @Anonymous,

 

If changes to the table structure are allowed, you can try the follow method.

Try this in query editor:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSkzJLKlMVNJRSs8vSMwB0sWlSRmpqUVKsTrRShmJRZlQocQ8EKsoMQsskZ1YAmLqAFUkZwOplEygeCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [name = _t, name1 = _t, name2 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"name", type text}, {"name1", type text}, {"name2", type text}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Columns",{{"Attribute", "Name_id"}})
in
    #"Renamed Columns"

Create a measure as:

Measure = 
if(
    ISFILTERED('Table'[Value]),selectedvalue('Table'[Value]),"organization")

Here is the output:

v-xulin-mstf_0-1615194417078.png

Here is the demo, please try it.

Best Regards,

Link

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

6 REPLIES 6
Subin
Frequent Visitor

Hi @amitchandak,

Thanks..its resolved for me too..

v-xulin-mstf
Community Support
Community Support

Hi @Anonymous,

 

If changes to the table structure are allowed, you can try the follow method.

Try this in query editor:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSkzJLKlMVNJRSs8vSMwB0sWlSRmpqUVKsTrRShmJRZlQocQ8EKsoMQsskZ1YAmLqAFUkZwOplEygeCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [name = _t, name1 = _t, name2 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"name", type text}, {"name1", type text}, {"name2", type text}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Columns",{{"Attribute", "Name_id"}})
in
    #"Renamed Columns"

Create a measure as:

Measure = 
if(
    ISFILTERED('Table'[Value]),selectedvalue('Table'[Value]),"organization")

Here is the output:

v-xulin-mstf_0-1615194417078.png

Here is the demo, please try it.

Best Regards,

Link

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

 

amitchandak
Super User
Super User

@Anonymous , Try a measure like

 

if(isfilterred(Table[name]),selectedvalue(Table[name]),"organization")

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
Anonymous
Not applicable

Hi amit,

I tried in the same format but if i put all 3 columns in slicer and if select bottom level then it is going to display top name.

I have written like below

Measure 2 = IF(ISFILTERED('Table 3'[name]),SELECTEDVALUE('Table 3'[name]),
IF(ISFILTERED('Table 3'[name1]),SELECTEDVALUE('Table 3'[name1]),
IF(ISFILTERED('Table 3'[name2]),SELECTEDVALUE('Table 3'[name2]),
"org")
)
)

@Anonymous , Seem fine. Try this one

 

Measure 2 = Switch(True(),
ISFILTERED('Table 3'[name]),SELECTEDVALUE('Table 3'[name]) ,
ISFILTERED('Table 3'[name1]),SELECTEDVALUE('Table 3'[name1]),
ISFILTERED('Table 3'[name2]),SELECTEDVALUE('Table 3'[name2]),
"org"
)

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
Anonymous
Not applicable

Hi amit,

THank you so much for the reply.i took three columns in table and if i select name then starting row of the value is displaying plz check attached image.displaydisplay

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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