How to do it...

  1. Open the import mode Power BI Desktop file and confirm that the two key columns (EmployeeKey and ParentEmployeeKey) exist in the Employee dimension table. If they don't, they can be added and hidden from Report view.
  2. In the data view, select the Employee table and add two calculated columns to expose the hierarchy path and length:
ManagementPath = PATH(Employee[EmployeeKey],Employee[ParentEmployeeKey]) ManagementPathLength = PATHLENGTH([ManagementPath]) 
The Employees table has 299 rows, but a logged in user should only see her data and the data of those that report to her directly or indirectly. For example, a vice president should still have visibility to a manager even if the manager reports to a senior manager who reports ...

Get Microsoft Power BI Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.