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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
skusulja
Frequent Visitor

Filter by user logged in

Hello everyone,

This is yes or no question, probably really simple one.

 

I have report which contains data about employees. How much cases they solved, how many hours they spent resolving certain issues etc. - basically it's their performance. Data is filtered by employees and teams and everyone can see everything. Question is - when an employee opens that report, can those filters be automatically selected so it shows data for that one person who opened the report? So it would probably be a DAX formula which goes to filter/slicer and selects employee based on user who is logged in and who is viewing the report. 

8 REPLIES 8
EKPuur
New Member

Hey everyone, 

 

Is there someone who has a solution for this problem in the meantime? 

 

If want to do the same thing as asked here so I was wondering if someone has some tips on how to do this. 

 

Thank you in advance!

Tahreem24
Super User
Super User

@skusulja ,

Yes, When you apply RLS (to restrict users from viewing data) so automatically all the report contents will be filtered out based on the permission of users who logged.

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

I do not want row level security (RLS) as a feature. I need that all data is visible to others. Just default that it is filter (visualization) to a particular user.

I have thought to add new DAX column to my Users table with expression:

CurrentUser = IF(USERPRINCIPALNAME()=Employees[SystemUser.UserName],TRUE(),FALSE())
 
However, I have error:
CUSTOMDATA, USERNAME, USERCULTURE and USERPRINCIPALNAME functions are not supported in calculated tables/columns. These functions may only be used in Measures or in the AllowedRowsExpression.
 
Ok, but is there any other way to set default filter on visualization to a current user?
 

@skusulja , check if you are able to create a measure like this

calculate(count(Employees[SystemUser.UserName]),Employees[SystemUser.UserName]= USERPRINCIPALNAME())

 

This can be used in visual level filter

 

refer : https://www.powerbi-pro.com/en/power-bi-display-measures-for-specific-users-only/

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

This measure returned blank for me. 
I tried couple of variations but I didn't get what I wanted. 
Anyway, this was supposed to be a small addition to my report, I'm not supposed to spend any more tome on this and we can go without it. 
Thank you all for your comments!

Hi @skusulja ,

 

  • If you are planning to share a single dashboard to multiple users then Row-Level security is the approach that should adopt.
  • If you are planning to distribute multiple dashboards for individual users than you can go with filter on Username. But, this approach is not the right way to go forward with.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

This is simple question about using Power BI Report in web.

Example is Sales report, where Filter (on page for example or visualization) persists, and should be default set to current user.
But user should be able to change this filter and see other sales performance in power bi report for other users.
It is just a question on setting value to a current filter (page filter or visualization filter) for which user to display the data.

It does not have nothing with Power BI Dashboards, nor Row level security

Pragati11
Super User
Super User

Hi @skusulja ,

 

You can look into Row-level security in Power BI.

https://radacad.com/row-level-security-configuration-in-power-bi-desktop

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.