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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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/

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.