Forum Discussion

mossshvlw's avatar
mossshvlw
Helper II
5 years ago
Solved

Using a card visualization with if/else statement

Hi all.

 

I have a card on a power bi report that I want to update based on row-level-security (RLS).  The RLS is set up to filter my data on the field "county."  Each RLS role only displays data for a single county.

 

When there is no RLS rules selected, I want the card to say "all counties".  When RLS is selected, I want the card to only display the name of the county filtered.  I'm using this measure to display in the card:

 

Filters Selected =
IF (
ISFILTERED ( data[County] ),
CONCATENATEX ( FILTERS ( data[County] ), data[County], ", " ),
"ALL"
)
 
With the logic being, either display the name of the county filtered, or display "all".  However, it's saying "all" even when RLS is activated.  any help appreciated, thanks.
  • mossshvlw yes because when RLS is applied it is not seeing that table isfiltered even thru RLS it is filtered as one country

     

    change ISFILTERED To HASONEVALUE

     

    Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

2 Replies

  • mossshvlw yes because when RLS is applied it is not seeing that table isfiltered even thru RLS it is filtered as one country

     

    change ISFILTERED To HASONEVALUE

     

    Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

    • mossshvlw's avatar
      mossshvlw
      Helper II

      Thanks.  This worked, but what exactly is RLS doing then?  Is RLS actually filtering the table?