Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
cmelgar
New Member

Filter Dashboard by UserName

Hi,

I am trying to filter my dashboard based on the UserName. However, when users open the dashboard in PowerBi service the results are not filtered. Please help.

 

CM

1 ACCEPTED SOLUTION

Hi @cmelgar,

Thank you for reaching out to the Microsoft Fabric Forum Community.

 

Thanks to @lbendlin, for the guidance! Since you have confirmed that USERPRINCIPALNAME() works in Power BI Desktop ("View As" mode) but does not apply in Power BI Service, the issue likely lies in how Row-Level Security (RLS) is configured and applied in the service. 

  • To properly verify RLS in Power BI Service, ensure you are testing with the correct permissions. If you are an Admin, Owner, or a Member with Edit permissions, RLS will not apply to you. To test correctly, go to Power BI Service → Dataset → Security, click on the role, and use “Test as Role” to check if filtering works. Alternatively, test using a user account with Viewer access in the workspace, as RLS only applies to Viewer roles. 
  • To verify if USERPRINCIPALNAME() is returning the correct format in Power BI Service, create a DAX measure: 
  • TestUser = USERPRINCIPALNAME() 
  • Add this measure to a table visual and compare its output with the UserName column in your dataset. If the dataset stores usernames in a different format (e.g., john.doe instead of john.doe@company.com), you may need to adjust the dataset or apply transformation logic in Power Query to ensure a correct match. 
  • If the report is shared via a Power BI App, ensure that users do not have access to the full dataset and that the app does not override RLS settings. If the report is shared directly, verify that users have only Viewer access in the workspace, as RLS applies only to Viewer roles. 
  • If users have Build permissions on the dataset, they may be able to bypass RLS. To restrict this, go to Power BI Service → Dataset, click Manage Permissions, and ensure that users do not have Build access unless absolutely necessary. 

Please refer the below links for better understanding: 

Solved: RLS does not apply even when adding colleagues as ... - Microsoft Fabric Community 

Row-level security (RLS) with Power BI - Microsoft Fabric | Microsoft Learn 

 

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

 

Thank you.

View solution in original post

8 REPLIES 8
v-saisrao-msft
Community Support
Community Support

Hi @cmelgar,
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.

cmelgar
New Member

Yes, I meant report. I did use the UserPrincipalName(), and it works in the desktop version when I use "view as". But in Power BI service it does not.

How are you testing it in the service and what does "it does not work" mean?

I am having users open the report that was published. When they open it they can still see other users numbers and details. This is what I meant by not filtering by user. 

Hi @cmelgar,

Thank you for reaching out to the Microsoft Fabric Forum Community.

 

Thanks to @lbendlin, for the guidance! Since you have confirmed that USERPRINCIPALNAME() works in Power BI Desktop ("View As" mode) but does not apply in Power BI Service, the issue likely lies in how Row-Level Security (RLS) is configured and applied in the service. 

  • To properly verify RLS in Power BI Service, ensure you are testing with the correct permissions. If you are an Admin, Owner, or a Member with Edit permissions, RLS will not apply to you. To test correctly, go to Power BI Service → Dataset → Security, click on the role, and use “Test as Role” to check if filtering works. Alternatively, test using a user account with Viewer access in the workspace, as RLS only applies to Viewer roles. 
  • To verify if USERPRINCIPALNAME() is returning the correct format in Power BI Service, create a DAX measure: 
  • TestUser = USERPRINCIPALNAME() 
  • Add this measure to a table visual and compare its output with the UserName column in your dataset. If the dataset stores usernames in a different format (e.g., john.doe instead of john.doe@company.com), you may need to adjust the dataset or apply transformation logic in Power Query to ensure a correct match. 
  • If the report is shared via a Power BI App, ensure that users do not have access to the full dataset and that the app does not override RLS settings. If the report is shared directly, verify that users have only Viewer access in the workspace, as RLS applies only to Viewer roles. 
  • If users have Build permissions on the dataset, they may be able to bypass RLS. To restrict this, go to Power BI Service → Dataset, click Manage Permissions, and ensure that users do not have Build access unless absolutely necessary. 

Please refer the below links for better understanding: 

Solved: RLS does not apply even when adding colleagues as ... - Microsoft Fabric Community 

Row-level security (RLS) with Power BI - Microsoft Fabric | Microsoft Learn 

 

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

 

Thank you.

Thank you for your help! I did everything prescribed, but one thing that I did not know was that users need to be added as "viewers" in the workspace. Also, if a link has been shared, this needs to show that users are not able to read/reshare. Otherwise, the filter won't work. After doing these two fixes now it works!

Hi @cmelgar,


Thank you for the update! I'm glad to hear that assigning users the Viewer role and adjusting the sharing settings resolved the issue.

If you found this information helpful, please consider marking the response as Accepted Solution this helps other community members who may face the same challenge.

 

Thank you

lbendlin
Super User
Super User

You cannot filter dashboards. Did you mean to say report?

 

Use Report URL filters or RLS and USERPRINCIPALNAME() to filter by user.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.