Forum Discussion

filiparibeiro's avatar
filiparibeiro
Icon for Helper III rankHelper III
4 years ago
Solved

Buttons Conditional Format - Hide buttons based on RLS

Hello. I'd like to know if there's any way to hide buttons that users should not have access to when navigating the report (based on Row Level Security), i.e., for each user it should only be visi...
  • speedramps's avatar
    speedramps
    4 years ago

    Hi again filiparibeiro

     

    Try this solution

     

    Click here to download an example 

     

    1) Create 3 report pages called Menu page, Page1 and Page2 .

     

    2) Hide Page1 and Page2

     

    3) Crarete security table:-

    4) Create these DAX measure

    Button1 page =  CALCULATE( MIN(Security[Page access]), Security[Page access] = "Page1")

    Button2 page =  CALCULATE( MIN(Security[Page access]), Security[Page access] = "Page2")

    Button1 colour = IF(CALCULATE(ISEMPTY(Security),Security[Page access] = "Page1"),"Grey","Green")

    Button2 colour = IF(CALCULATE(ISEMPTY(Security),Security[Page access] = "Page2"),"Grey","Green")

    5) = Configure button actions
    Set action for Button1 = Page Navidation, Desinatiin FX = Field values = Button1 page
    Set action for Button2 = Page Navidation, Desinatiin FX = Field values = Button2 page

     

    6) = Configure button colours.

    Click on button1 / format / Style / Fill / Colour fx = Field value = Button1 colour
    Click on button2 / format / Style / Fill / Colour fx = Field value = Button2 colour

     

    7) Create row level security for each role

     

    😎 Test the Menu page by clicking on Modelling / View as 
     

    • View as Customer = Green button 1 and button 2 grey and disabled
    • View as Supplier = Green button 2 and button 1 grey and disabled
    • View as Manager = Button 1 and button 2 green

     

    Thanks for reaching out for help.

    I have helped you, now please help me by giving kudos.

    Remeber we are unpaid volunteers and here to coach you with Power BI and DAX skills, not do users job for them !

    So please click the thumbs up and accept as solution button. 

    One question per ticket please. If you need to extend your request then please raise a new ticket.

    You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you !