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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.