Forum Discussion

stitch_es's avatar
stitch_es
Frequent Visitor
2 years ago
Solved

Conditional Formatting being removed when using Row Level Security

Hi - Hope someone on here can help me.

I have a simple report that shows logs per user on a daily basis.  The idea is to highlight when they skipped a day (or days) of logging in.  My code has the current scan date, and I have a field that calculates the difference between current date and previous scan date to know if it's more than 1.

 

I then have conditional formatting - if the difference is > 1 change background to orange.  All is working perfectly - until row level security kicks in. If you are viewing the report and able to see all data, it's fine.  If you log in as a user who only can see a subset of data then the conditional formatting gets removed.  See below for screenshots:

 

All Data:

Viewing data that only has access to site 838 - no formatting:

 

I have searched the web, but can't find anything.  Anybody have any ideas??

 

  • stitch_es's avatar
    stitch_es
    2 years ago

    Hi - Thank you so much for responding.

    When cleaning up the file to share with you, I was making my DirectQuery all into Direct Import mode so that the pbix wouldn't need to connect to the db.  Then it worked and the formatting stayed the same.  Is there something with Direct Query that would prevent the conditional formatting to carry over when being filtered?  The value that it is using to determine the formatting does not change - see below:

    all data:

    using RLS:

     

5 Replies

  • stitch_es , can you add the value on the visual, in which conditional formatting is done? I doubt that is also changing here.

     

    If this does not help
    Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

    • stitch_es's avatar
      stitch_es
      Frequent Visitor

      Hi - Thank you so much for responding.

      When cleaning up the file to share with you, I was making my DirectQuery all into Direct Import mode so that the pbix wouldn't need to connect to the db.  Then it worked and the formatting stayed the same.  Is there something with Direct Query that would prevent the conditional formatting to carry over when being filtered?  The value that it is using to determine the formatting does not change - see below:

      all data:

      using RLS:

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Thanks for the reply from amitchandak , please allow me to provide another insight:

        Hi, stitch_es 

        Based on our understanding of what you need to seek, there are no similar problems so far, and here's how I measured it:

        1.First I have created the following table and the column names and data are the data you have given:


        2.Next, I'll modify each column of the visualization like this:


         

         

        3.Then I created the following RLS:
         

         

        4.Using this role to observe, here are the actual results

        Here's the version number I'm using:
         

         

        It is recommended that you try to upgrade the version according to your needs to see if this can solve the problem, the following is the official link:

         Download Microsoft Power BI Desktop from Official Microsoft Download Center

         
        Of course, if you have any new ideas, you are welcome to contact us.
         

        Best Regards,

        Leroy Lu

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