Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

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. now if i select in slicer then the respective name should display in card.   Fo...
  • v-xulin-mstf's avatar
    5 years ago

    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:

    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.