Forum Discussion

JustinDoh1's avatar
JustinDoh1
Icon for Post Prodigy rankPost Prodigy
1 year ago

How do I use RLS (or some other way) to show/hide these visuals?

I have uploaded my PBIX file here.

 

This question is somewhat related to my previous post, but business requirement has been changed, so I am posting this question.

 

I have these three visuals (ALI, ARB & AVI: created with Parameters).

 

Initially, I used Bookmarks to show and hide these visuals separately, but now, requirement has been chnaged -->

I would like to use just a regular filter like "Location" to display/hide these three visuals.

 

I created relationship between "Location" table and respective three tables that were created with parameter to see if there is any way it could be done.

 

Is there anyway I could do it with RLS or with some other method?

6 Replies

  • Hi JustinDoh1 ,

     

    Yes, you can hide entire visuals based on RLS.  Assuming that you have already created the RLS rules and then you can create a DAX measure that hides the visual based on role.

     

    Something like this:

    HideVisualMeasure = IF(ISUSERINROLE("RoleName"), 1, BLANK())

     

    Then, in the visual, do the conditional formatting and use the measure to change the color or the visiblity or whatever settign you desire to make it "hidden"

    • JustinDoh1's avatar
      JustinDoh1
      Icon for Post Prodigy rankPost Prodigy

      collinq Thank you so much. Great to know.

      Is it possible for you to demonstrate/show me on my PBIX file by chance?

      • JustinDoh1's avatar
        JustinDoh1
        Icon for Post Prodigy rankPost Prodigy

        collinq 

        I would like to follow up on my inquiry (whether you could show me on a PBIX file).

        I tried RLS like below (traditional way), but obviously those three visuals would not do anything.

        I am not sure how you can implement the measure you mentioned on the top. (I just cannot get my head around  😞   / I don't know where it should be placed..) 

         

        What is "ISUSERINROLE"? I thought it is one of name of functions in PowerBI, but I guess not.

         

        Just in case needed, I have uploaded latest PBIX file here.

         

        Thanks.

         

         

         

         

         

    • JustinDoh1's avatar
      JustinDoh1
      Icon for Post Prodigy rankPost Prodigy

      collinq I am trying to apply a measure something like 

      HideVisualMeasure_ALI = IF(ALI[ALI Value],1,BLANK())  on my latest PBI file here.
      I am not sure how RLS is applied (it does not matter if RLS is used or not), but I am still confused as far as how to apply a central measure to individual visuals to hide using conditional formatting at this point.

      Thanks.

      • collinq's avatar
        collinq
        Icon for Super User rankSuper User

        HI JustinDoh1 ,

         

        After revewing your file I was making a couple of assumptions about your data structure.  SO, the easiest way that I think to do this is to change your three separate slicers from three separate tables that you created for ALI, ARB and AVI and just use the Location value out of the tblscore table.  This means that you can use the new TITLE SLICER and have all three available but when you use your RLS it automatically gets rid of the other two.  This is what it looks like before using the RLS:

         

        Then, after using the RLS of the ALI:

         

        My other suggestion then is to use the data from the tblscore or the Location table itself.  Then, you do not have to have the three created tables that you made but you could put the measures for the KEY and VALUE that you have in the three separate tables.