Forum Discussion

cmelgar's avatar
cmelgar
New Member
1 year ago
Solved

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

  • 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 [email protected]), 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.

8 Replies

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

     

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

  • 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.

    • lbendlin's avatar
      lbendlin
      Super User

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

      • cmelgar's avatar
        cmelgar
        New Member

        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. 

  • v-saisrao-msft's avatar
    v-saisrao-msft
    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.