Dynamic security models in Power BI filter tables based on the relationship of the logged in user to a column or columns stored in the data model. The USERPRINCIPALNAME() DAX function returns the user's UPN per the first recipe of this chapter, and a filter expression of a security role accepts this value as a parameter. Like all filters in Power BI data models, the filters applied in security roles also filter other tables via one-to-many and bidirectional relationships. Security roles can also blend dynamic, user-based filters with standard security filters to further restrict the visibility of members mapped to these roles.
This recipe implements dynamic security on an Employee dimension table such that users (employees) logged into Power BI can only view their own data and the data of those who report to them directly or indirectly...