Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
PATHCONTAINS(Emp[epath],MAXX(FILTER(Emp,Emp[email] = USERPRINCIPALNAME()),Emp[id]))
above role is not working
id name email manager epath
| 1 | krishna | krishna@taged.onmicrosoft.com | 1 | |
| 2 | testuser1 | tester1@taged.onmicrosoft.com | 1 | 1|2 |
| 3 | testuser2 | tester2@taged.onmicrosoft.com | 2 | 1|2|3 |
| 4 | testuser3 | tester3@taged.onmicrosoft.com | 2 | 1|2|4 |
| 5 | testuser4 | tester4@taged.onmicrosoft.com | 2 | 1|2|5 |
id sales
| 1 | 100 |
| 2 | 40 |
| 3 | 50 |
| 2 | 45 |
| 4 | 77 |
| 5 | 23 |
@mgwena @cham @amitchandak @Greg_Deckler @Mariusz
Solved! Go to Solution.
Hi @Truelearner ,
In Manage roles, you can create roles and try this DAX expression to solve your problem:
IF (
CALCULATE (
COUNTROWS ( 'Emp' ),
FILTER ( 'Emp', 'Emp'[email] = USERPRINCIPALNAME () )
) > 0,
[id]
= CALCULATE (
MAX ( 'Emp'[id] ),
FILTER ( 'Emp', 'Emp'[email] = USERPRINCIPALNAME () )
),
[email] = USERPRINCIPALNAME ()
)When you use View as roles, you will get the following result:
Here is the demo, please try it:
Best Regards,
Yingjie Li
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Truelearner ,
In Manage roles, you can create roles and try this DAX expression to solve your problem:
IF (
CALCULATE (
COUNTROWS ( 'Emp' ),
FILTER ( 'Emp', 'Emp'[email] = USERPRINCIPALNAME () )
) > 0,
[id]
= CALCULATE (
MAX ( 'Emp'[id] ),
FILTER ( 'Emp', 'Emp'[email] = USERPRINCIPALNAME () )
),
[email] = USERPRINCIPALNAME ()
)When you use View as roles, you will get the following result:
Here is the demo, please try it:
Best Regards,
Yingjie Li
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
@Truelearner ,On a Card please check what USERPRINCIPALNAME() is coming. and then check if is matching with email of not
CHECKED ,, I TRIED IN DESKTOP USING USER ROLES AS WELL
I CAN SEND THE FILE IF REQUIRED , CAN YOU TELL ME HOW CAN I ATTACH PBIX HERE I DONT SEE ANY OPTION
ucan download it here
https://drive.google.com/open?id=1OFQ9RsF9ZtxsZVU-JpsYZ1mAXvA-yY_p
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 37 | |
| 34 | |
| 31 | |
| 27 |
| User | Count |
|---|---|
| 136 | |
| 99 | |
| 73 | |
| 66 | |
| 65 |