Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Power BI - How to show/hide pages based on the user?

Hi
I have a single report that is made up of five pages - named Full Company, North, East, South, West.
The pages North, East, South, and West are the exact same layout but will only show the data for those regions (I haven't create a single page layout and RLS in this case). The Full Company will is a slighly different layout as it encompasses all the regions data. So the point I'm making here is that they are individual pages within the same report.

 

I would like it so, dependant on the user, they can only see the pages they are allowed it. For example,
The company CEO logs in and should see the Full Company, North, East, South, and West pages.
The south regional director logs in and should see only the South page.

 

Can this be done and how so (any links demonstrating the required)?
Thanks in advance.

10 REPLIES 10
cash-marie
Regular Visitor

Supposed your PowerBI have pages { A, B, C... n}

1. Deploy your PowerBI web service to PowerBI Embedded (hosted as a web application)

2. create API to manage role based access

3. use PowerBI Embedded API to modify which roles can access which pages Power BI Playground - Explore our APIs

 

- set page navigation to false

cashmarie_0-1671120769617.png

- set the powerbi report page navigation via the web app scripts / JS controls

 

Anonymous
Not applicable

So my plan is this:

1) I will create a Bookmark for each page (Full Company, North, East, etc..).

2) I will create a single column table (named Page) which will hold the exact names of the Bookmarks ( i.e. 'Full Company', 'North', etc..).

3) I will create RLS against the Page table.

4) I will set the RLS so the CEO is allowed to see all the pages (so the CEO will be configured in the RLS to see 'Full Company', 'North', 'West', etc..).

5) I will place a slicer visual on the home page that will show/list the values from the Page table based on the user's RLS priviledges (so the CEO will see a slicer visual showing the values 'Full Company', 'North', 'East', 'South', and 'West').

All works so far.

Now I just need to bind the Bookmark against the selected slicer visual value. For example, when the CEO sees the slicer list of values and he clicks on, say, the 'North' checkbox then the 'North' bookmark (page) will appear.

I will have a button on each bookmark (page) that, when clicked, will return the user to the home page so they can select, if priviledges permit, another slicer checkbox, which in turn will show the bookmark/page.

I have seen the Button object where you can set the action property to show the bookmark, however you would have to create all the buttons in advance whereas the slicer visual will dynamically work off the RLS and therefore only show the allowed list in the form of checkboxes.

If the approach I'm taking is not the recommended approach then do let me know.

My questions now are:
1) How do I bind the slicer visual checkbox property to show the bookmark?

2) If the use of Buttons (through their Action property) is the only way to show Bookmarks then how can I show Buttons dependant on what the RLS grants?  Let's say the RLS provides only 'North' and 'East' and I drag the Page table field in a normal table visual then I see North and East in the table values list - can I use DAX to say if the table has the value of North then show the North Button (which, when clicked, will be configured to show the North Bookmark/page?)

Thanks.

Anonymous
Not applicable

Bump. Can anyone help?

Hi @Anonymous ,

Nope, I don't think it is possible. Current power bi not contain features to control report page visible.

In my opinion, I'd like to suggest setup RLS on table records to display records based on username, these unmatched pages visuals data will be filtered. RLS with UserName()

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

@Anonymous as it is not possible to have dynamic buttons , you can use RLS as suggested by @v-shex-msft  and then have a nice message if someone go to a page which he/she doesn't have access to.

 

For example use A cannot see "North" page and he click on "North" button on main page, since RLS is applied, he will not see any data but you can show a message on that page saying "you don't have access to data for North Region".

 

I don't think there is any solution what you are trying to achieve, atleast at this point



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Thanks for your replies.

 

Is there a link that shows an example of how to do this?  If not, no problem as I'll figure it out but am keen to know if there is an example that shows the best practice.

@Anonymous do you need example on bookmarking?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hi @parry2k 

 

It was more an example of on:
"For example use A cannot see "North" page and he click on "North" button on main page, since RLS is applied, he will not see any data but you can show a message on that page saying "you don't have access to data for North Region"."

 

I was more looking for an example of how when clicking on a button a message appears. The example of showing a message - is it a message box that appears, or is it a new page that appears saying 'You do not have access', or is it something else.

Thanks.

Anonymous
Not applicable

Hi @parry2k 

I will take that example if the offer is still there?

Another thought I'm having is, can I create a Button, one for each page (i.e. one button for Full Company, another button for North, and so) that when clicked will take the user to the bookmarked page? However I would need a way to hide the buttons based on RLS, so the North manager can only see the North button on the home page and the other buttons remain hidden/invisible - can this be done?

I'm keen to go with whatever the best approach is??

Thanks.

 

@Anonymous it is going to be a measure to show the message, and the text in that measure will be blank if user has the permission. Hope it make sense, if you still need help, I can put together something.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.