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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Gutenvirt
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
v-yuezhe-msft
Employee
Employee

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.
MFelix
Super User
Super User

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 Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.