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
Hello everyone,
I'm facing an issue with the use of Username() or UserPrincipalName() in a report
I have to build a report to allow my ressources to track the projects on which they are assigned, I cannot used RLS due to the need of this ressources to see more details on other reports using the same dataset
If I use the following measure:
The ID in the ressources table, is the project ID, so my table ressource contains this kind of information
| ID Project | ResourceMail |
| 1 | ResourceA@microsoft.com |
| 2 | ResourceA@microsoft.com |
| 2 | ResourceB@microsoft.com |
| 2 | ResourceC@microsoft.com |
| 3 | ResourceB@microsoft.com |
| 3 | ResourceC@microsoft.com |
Solved! Go to Solution.
Try this measure
ProjectResourceVisibility =
VAR CurrentUser = USERPRINCIPALNAME()
RETURN
IF(
CALCULATE(
COUNTROWS(Ressources),
FILTER(Ressources, Ressources[ResourceMail] = CurrentUser)
) > 0,
1,
0
)
Try this measure
ProjectResourceVisibility =
VAR CurrentUser = USERPRINCIPALNAME()
RETURN
IF(
CALCULATE(
COUNTROWS(Ressources),
FILTER(Ressources, Ressources[ResourceMail] = CurrentUser)
) > 0,
1,
0
)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 63 | |
| 55 | |
| 42 | |
| 41 | |
| 23 |
| User | Count |
|---|---|
| 171 | |
| 136 | |
| 119 | |
| 79 | |
| 54 |