Forum Discussion

arimoldi's avatar
arimoldi
Icon for Resolver II rankResolver II
2 years ago
Solved

Show Selected Filter Value "ALL"

Hi,

 

I want to create a card to display the selected values of a slicer, I created a measure in this way:

 

Display Name =
    IF(
        ISFILTERED(field_1),
        SELECTEDVALUE(field_1),
        "ALL"
    )
 
But when all the values in the filter are selected instead of "ALL" i get blank.
 
Do you why am I getting blank instead of "ALL" and how to solve it?
 
Thanks,
Andrea
  • I solved in this way:

     

    IF( ISBLANK(IF(
        ISFILTERED(field1),
        SELECTEDVALUE(field1),
        "All"
    )),"All",SELECTEDVALUE(field1))
     
    Hope it could helps other.
     
    Thanks!

6 Replies

  • Daniel29195's avatar
    Daniel29195
    Icon for Community Champion rankCommunity Champion

    arimoldi 

     

    use this measure : 

    measure

    var rows_count =  countrows (all(table_name[field_1]))

    var filtered_rows_count =  countrows( values(table_name[field_1]))

     

     

    return 

    switch(

    true(), 

    if rows_count =  filtered_rows_count , "ALL", 


    concatenateX ( values(table_name[field_1]) , values(table_name[field_1]) , unichar(10)) 

     

     

    If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. I would appreciate hitting that kudos button 👍🤠

  • arimoldi 

    SELECTEDVALUE has a second parameter to show if the value selected is more than one of nothing is selected. Use your measure as follows:

    Display Name =    SELECTEDVALUE(field_1, "ALL" )

    • arimoldi's avatar
      arimoldi
      Icon for Resolver II rankResolver II

      Thanks,

       

      now it correctly shows "ALL" when all the values of the filter are selected; do you how to use concatenatex to shows all the selected values of the filter (eg value1, value2)?

       

      Thanks,

      Andrea