Forum Discussion

datboioscarr's avatar
datboioscarr
Frequent Visitor
5 years ago

Return Value based on Hierarchy in Power BI

Afternoon/Morning Power BI Community. 

 

I'm a new Power BI user and have a few questions around an issues that I'm running into regarding a dashboard I'm working on for my team. Here is a quick summary:

I'm working on a dashboard that will enable our users to check what access level they have to a set of applications managed by the business. The way that I have the data currently setup is as follows:

 

1. I'm pulling data from our Active Directory database that contains the the following values: username and acces level assigned to each user. I've name the resource Data Access Group 

2. I've created a custom table titled Data Access Level in Power BI that summarizes the data levels avaialbe (i.e base, advanced, advanced all)

 

The relationship established between the two data resources is based on the Access Level. Once that has been set, I have a slicer on the dashboard that lists the name of the users that have access to the application in reference. The slicer is pulling the names from the Data Access Group resources. When a name is selected on the slicer, I have a table that highliest the Data Access Level the user has. For instance, if I select James Smith on the slicer, the table highlights what level access James Smith has (base, advanced, etc). Here is the DAX code I'm using to complete this: 

 

Highlight w Slicer = VAR SelectedDisplayNames = SELECTEDVALUE( 'Group Display Name'[group.member.displayName] )
RETURN
CALCULATE(
DISTINCTCOUNTNOBLANK( 'group'[group.member.displayName] )
, FILTER( 'group'
, 'group'[group.member.displayName] = SelectedDisplayNames ) )
 
The issue that I am running into is that, a user can have multiple access level...James Smith can have both base and advanced level access. What I would like to do is have it setup so that the highlighted level returns the highest level access - so if James Smith has both base and advanced, I want the table to only highlight the advanced level access James Smith has. I know to accomplish this I need to setup a hierarchy but not sure the best way to approach that....Is there a way to filter the original data to only return the highest level??

 

 

 

3 Replies