cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gutenvirt Frequent Visitor
Frequent Visitor

Simple User Filtering options

I'm trying to filter data by the username of the current logged-in client.  I realize there are solutions to this, RLS is enabled, but we don't have SSAS to manage the aggregations outside of PBI.  

 

I created a measure that looks up a 'tag' value of the username() and a table that matches the username to a site location.  Then I'm trying to create a column that calculates the max of the site number and filter on the measure's value.

 

CheckSite = IF(LOOKUPVALUE(UsersTab[Tag], UserTabs[Domain], USERNAME()), 1, 0)

 

CheckSecurity = CALCULATE(MAX(UsersTab[Site_Number]), FILTER(UsersTab, [CheckSite]= 1))

 

I was hoping to use the CheckSecurity column as a report-level filter, but I get an error that username() is not allowed in columns.

 

I'm trying to circumvent these restricts, but so far no luck.

 

Thanks!

2 REPLIES 2
Super User III
Super User III

Re: Simple User Filtering options

Hi @Gutenvirt,

 

Did you try to create the roles in the Pbix file based on the information you want user to see and then add the e-mails of each user in the power bi online? It's a little work at first but after the first setup it works nice, at least in my testing it worked.

 

MFelix


Regards

Miguel Felix


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




Moderator v-yuezhe-msft
Moderator

Re: Simple User Filtering options

Hi  @Gutenvirt

Currently, in Power BI Desktop,  it is not supported to use USERNAME() function in calculated column, you can vote the following idea about this issue.

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/13926666-provide-username-functio...

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors
Top Kudoed Authors