Forum Discussion

Gutenvirt's avatar
Gutenvirt
Frequent Visitor
9 years ago

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