Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hey guys,
I created a dashboard in Power BI with some sales information. In this report I applied RLS security so that users only see information about themselves, that is, they can only see the sales they made so as not to see information from other users. In this dashboard I need to create a dynamic title that brings the user's name respecting the RLS applied, that is, if the user's name is "Jhon M. Stan" the title needs to be "Jhon M. Stan", as the filter applied to the RLS is "John M. Stan".
I tried using a SELECTEDVALUE in the table column where the seller's name is, but that didn't work, as the filter is in RLS and not in a data segmentation.
Please, would anyone know how to do this?
Hi @Rai_BI ,
In Power BI Desktop, username() and userprincipalname() function will return the domain\user, but in Power BI Service, userprincipalname() function will return the upn name.
I create a sample for you:
1. below is my test data
Table:
2. create a role
3. create a measure
Measure = USERPRINCIPALNAME()
4. add a table visual with Table fields and set the title text
5. result
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Rai_BI
If you could expalin this part of your question?
"I tried using a SELECTEDVALUE in the table column where the seller's name is, but that didn't work, as the filter is in RLS and not in a data segmentation."
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
I meant that the SELECTEDVALUE function does not work if there is no filter in the data slicer. As the filter is applied to RLS, the SELECTEDVALUE function is useless in this case.
Hi,
I am not sure if I understood your question correctly but please try to write a measure like below and put it into the card visualization. And then publish it to the service.
Each user will see his/her name on the report.
Show user name measure: = USERPRINCIPALNAME()
USERPRINCIPALNAME function (DAX) - DAX | Microsoft Learn
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
It's not working as expected. It's bringing the user name like the following example "SERVBUSINESS\USER" and that's not what I'm looking for.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
46 | |
27 | |
21 | |
12 | |
8 |
User | Count |
---|---|
74 | |
52 | |
45 | |
15 | |
12 |