Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hello,
I am looking to implement row level filtering in DAX using the userprincipalname() function. I have two data tables, one with the salary data, and another with the employee access details. If an employee is allowed to have access to the data for a department, they can view the data, if not, I'd show something like "Hidden" instead of the actual value.
As an example if my salary data looks like this:
Salary Data:
EmployeeDepartmentSalaryLevel
| Emp1 | AB | 100 | 1 |
| Emp2 | AB | 200 | 2 |
| Emp3 | BC | 100 | 1 |
| Emp4 | BC | 300 | 2 |
| Emp5 | BC | 400 | 3 |
| Emp6 | DE | 500 | 4 |
| Emp7 | DE | 100 | 2 |
And the Access Data is as follows:
EmployeeDepartment
| Emp1 | AB |
| Emp2 | DE |
| Emp3 | AB |
| Emp1 | BC |
| Emp3 | BC |
| Emp3 | DE |
Now, if Emp1 is viewing the report (Username() = "Emp1"), they'd see be able to see the following:
| Employee | Department | Salary | Level |
| Emp1 | AB | 100 | 1 |
| Emp2 | AB | 200 | 2 |
| Emp3 | BC | 100 | 1 |
| Emp4 | BC | 300 | 2 |
| Emp5 | BC | 400 | 3 |
| Emp6 | DE | Hidden | Hidden |
| Emp7 | DE | Hidden | Hidden |
I tried implementing this using the following measure:
Filtering =
This gives me an error saying "Each table argument of 'Intersect' must have the same number of columns. I also tried concatenating the departments in the Access Table - so Emp1 would have departments AB, BC. Then I tried using the IN function, but that doesn't work either.
Would anyone know how I could implement a solution to flag rows that are in another table and then show the values in a column accordingly? I'd appreciate any help.
Thank you!
@newpbiuser01 do you want to completely hide the row or want to show the value "Hidden" in place of salary and level?
What is the ask here?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi @parry2k ,
I want to show the value "Hidden" instead of the actual value for the Salary and Level columns if the user does not have access the data for that department. This way the user can see some other columns (that I haven't shown in this example) but just can't see the senstive data.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 58 | |
| 53 | |
| 40 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 114 | |
| 107 | |
| 41 | |
| 34 | |
| 25 |