Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

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...
  • MatthRichardsUK's avatar
    3 years ago

     

    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.