I have already done a video/post on how to implement a static drop down navigation, so in this tutorial I will cover how to implement a dropdown navigation where options are dynamically populated based on the identity of the user.
The Power BI desktop file used in this tutorial can be downloaded here.
The steps are the following:
- Create the Navigation table that will contain all of the pages available to navigate to
- Create a mapping table that will specify which pages are available to which user
- Create a Row Level Security rule to apply DAX filter on the Navigation table to dynamically filter pages that the user is not supposed to see
Relationships – make sure the two tables are not connected:
currentUser = USERPRINCIPALNAME()
NavigatePage = var page = SELECTEDVALUE(Navigation[Page]) var pageNo = SELECTEDVALUE(Navigation[Sort Order]) return IF(pageNo = 0, BLANK(), page)
DAX for RLS:
[Sort Order] = 0 || contains ( NavigationMap, NavigationMap[Page], [Page], NavigationMap[User], [currentUser] )