Forum Discussion

23Steve32's avatar
23Steve32
Frequent Visitor
7 years ago
Solved

Is there a way to tell if RLS is filtering a table using dax

As the subject says, I would like to know if a table has been filtered via RLS - it doesnt look like ISFILTERED picks up on RLS filtering. Is this possible and if so how? 

 

Thanks in advance,

Steve

  • TeigeGao's avatar
    TeigeGao
    7 years ago

    Hi 23Steve32 ,

    As I mentioned above, we can't create a measure to judge if the data has been filtered, RLS is applied at the dataset level, the measure is created inside the dataset. For objects inside the dataset, it is just the "full" dataset.

    Best Regards,

    Teige

4 Replies

  • TeigeGao's avatar
    TeigeGao
    Icon for Solution Sage rankSolution Sage

    Hi 23Steve32 ,

    Only the owner of dataset can see if the dataset has been set RLS from the Security tab in PowerBI Service, it is a dataset level filter, we can't judge it inside a dataset using a function.

    Best Regards,

    Teige

    • 23Steve32's avatar
      23Steve32
      Frequent Visitor

      Hi TeigeGao ,

       

      Sorry if I wasn't clear, I own the dataset, I have set up some roles in the desktop which will filter different tables depending upon who is accessing the report in the service. 
      Basically I have a measure which will look at values from one table if the RLS filters that table other wise it should get the data from another table. I thought the ISFILTERED function would work but it doesnt seem to, so is there a way in a measure to tell if a table has been filtered by RLS?

       

      Hope this makes sense,

      Steve

      • TeigeGao's avatar
        TeigeGao
        Icon for Solution Sage rankSolution Sage

        Hi 23Steve32 ,

        As I mentioned above, we can't create a measure to judge if the data has been filtered, RLS is applied at the dataset level, the measure is created inside the dataset. For objects inside the dataset, it is just the "full" dataset.

        Best Regards,

        Teige

  • cnonline's avatar
    cnonline
    Regular Visitor

    Try creating a simple count measure to RLS table if your using dynamic RLS. But I guess this will work for the usual RLS scenario as well. (RLS is my bridging table) This worked for me!

     

    RLS Count = DISTINCTCOUNT(RLS[UNAME])

     

    And then I created an another switch measure to change a simple icon image in the report. You can do anything with in switch.

     

    RLS Secuity check = SWITCH(
        TRUE(),
        [RLS Count]<=1,"Image link to identify RLS applied", 
        [RLS Count]>1,"Image link to identify RLS not applied", 
        "Default image link"
    )