Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi,
New to powerbi and I was wondering if someone could help with a DAX expression. I have a users table with UserID, Username and a column called FinanceAccess. The FinanceAccess column has values, Y and N. Anyone with Y can access the report and people with N should not have access.
I'm unsure how to write the DAX here. I've written the following but I get an error message. Thanks for the help. 🙂
[Username] IN
SELECTCOLUMNS (
            FILTER (
             'Users_', 
             'Users_[FinanceAccess])
                = "Y" 
             ),
            "Username", [Username]
)
Solved! Go to Solution.
Hey @WarrenStaples ,
the problem is the filter direction in the data model.
Check the following criteria for the sales table:
[NetworkID] in 
SELECTCOLUMNS (
    FILTER (
        Network,
        RELATED ( Users[Username] ) = USERPRINCIPALNAME () && RELATED(Users[FinanceAccess]) = "Y"
    ),
    "NetworkID", Network[NetworkID]
)
 
					
				
		
Hi Mate,
You can try the following expression:
This table is mapping table and its connected to main table with 1:Many relationship.
I received expected output.
Hey @WarrenStaples ,
where do you want to use that?
Is that the criteria for a role?
Is username the e-mail address? Then you could use USERNAME() or USERPRINCIPLENAME() to check against the table.
@selimovd Yes, I would like to use Username() to check against the table and use in the manage roles section. Basically anyone with FinanceAccess marked as Y should have access to the report.
Hey @WarrenStaples ,
then use the following DAX code for the row level security:
Users_[Username] = USERNAME() && Users_[FinanceAccess] = "Y"
Hey @WarrenStaples ,
the problem is the filter direction in the data model.
Check the following criteria for the sales table:
[NetworkID] in 
SELECTCOLUMNS (
    FILTER (
        Network,
        RELATED ( Users[Username] ) = USERPRINCIPALNAME () && RELATED(Users[FinanceAccess]) = "Y"
    ),
    "NetworkID", Network[NetworkID]
)
@selimovd Thanks Denis. And what do you have in the Roles in the User table? I have the following below but for example, Sam in the table doesn't see anything although he has a Y flag. Perhaps you could attach the file you worked on above? Thanks again.
Hey @WarrenStaples ,
Sam has UserID 8:
He doesn't see anything because in the related table he doesn't have any data or network connected:
From your first description you wanted 2 criteria:
1. The users see the data they have access to. Sam doesn't, so he won't see anything
2. If the user has a "Y" on Finance Access he is in addition allowed to see the financial data from table Sales.
Please let me know if I understood anything wrong.
Hi Denis, You're right. Thank you.
Hey @WarrenStaples ,
no problem. I'm happy it worked eventually 🙂
If you need further help just let me know.
 
					
				
				
			
		
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
 
            | User | Count | 
|---|---|
| 87 | |
| 49 | |
| 36 | |
| 31 | |
| 30 |