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
Anonymous
Not applicable

filter on a page usign USERNAME()?

I was wondering, how can I have a Page level filer by the logged person in username()

 

This is not RLS, since the person should be able to see data for all users, but for a specific page I want to show the person's only

data, how can it be done?

1 ACCEPTED SOLUTION
MatthRichardsUK
Resolver I
Resolver I

 

That's correct, you cannot use the USERNAME or USERPRINCIPALNAME functions as a column in a table. However, you can use these functions in a measure to filter the data at the visual level. Here's how you can do this:

  1. Create a new measure using the USERNAME or USERPRINCIPALNAME function. For example:
    LoggedInUser = USERNAME()
    1. Add the measure to the table or matrix visual that you want to filter.

    2. Click on the visual and go to the "Format" tab in the top menu.

    3. In the "Filters" section, click on the "Add" button.

    4. In the "Add filter" window, select the measure that you created as the field to filter by.

    5. In the "Filter type" dropdown, select "Advanced".

    6. In the "Advanced Filter" window, select the operator and value for your filter. For example, you can use the "=LoggedInUser" measure to filter the data for the logged in user.

    7. Click "OK" to apply the filter.

      I hope this helps! Let me know if you have any questions.

View solution in original post

4 REPLIES 4
Veigale
Frequent Visitor

What is the version of this Power BI, I can't find this path described.

MatthRichardsUK
Resolver I
Resolver I

 

That's correct, you cannot use the USERNAME or USERPRINCIPALNAME functions as a column in a table. However, you can use these functions in a measure to filter the data at the visual level. Here's how you can do this:

  1. Create a new measure using the USERNAME or USERPRINCIPALNAME function. For example:
    LoggedInUser = USERNAME()
    1. Add the measure to the table or matrix visual that you want to filter.

    2. Click on the visual and go to the "Format" tab in the top menu.

    3. In the "Filters" section, click on the "Add" button.

    4. In the "Add filter" window, select the measure that you created as the field to filter by.

    5. In the "Filter type" dropdown, select "Advanced".

    6. In the "Advanced Filter" window, select the operator and value for your filter. For example, you can use the "=LoggedInUser" measure to filter the data for the logged in user.

    7. Click "OK" to apply the filter.

      I hope this helps! Let me know if you have any questions.

amitchandak
Super User
Super User

@Anonymous , Please check reply from @MatthRichardsUK  first.

 

But as far as I am aware you can not use username and userprincipalname in a column. This means you have to create a measure and you can use measure only in the visual level filter, not page level.

 

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
MatthRichardsUK
Resolver I
Resolver I

In Power BI, you can create a page level filter by using a report-level filter or a page-level filter.

To create a report-level filter, follow these steps:

  1. Click on the "File" tab in the top menu and select "Options and settings".
  2. In the Options and settings window, select "Filters".
  3. In the Filters window, click on the "New" button.
  4. In the "New filter" window, give your filter a name and select the field that you want to use as the filter.
  5. In the "Filter type" dropdown, select "Advanced".
  6. In the "Advanced Filter" window, select the operator and value for your filter. For example, you can use the "=Username()" function to filter the data for the logged in user.
  7. Click "OK" to apply the filter.

To create a page-level filter, follow these steps:

  1. Go to the page that you want to add the filter to.
  2. Click on the "Format" tab in the top menu and select "Page level filters".
  3. In the "Page level filters" window, click on the "Add" button.
  4. In the "Add filter" window, give your filter a name and select the field that you want to use as the filter.
  5. In the "Filter type" dropdown, select "Advanced".
  6. In the "Advanced Filter" window, select the operator and value for your filter. For example, you can use the "=Username()" function to filter the data for the logged in user.
  7. Click "OK" to apply the filter.

I hope this helps! Let me know if you have any questions.

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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.