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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
newpbiuser01
Helper V
Helper V

Row Level Filtering in DAX

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

Emp1AB1001
Emp2AB2002
Emp3BC1001
Emp4BC3002
Emp5BC4003
Emp6DE5004
Emp7DE1002

 

And the Access Data is as follows:

EmployeeDepartment

Emp1AB
Emp2DE
Emp3AB
Emp1BC
Emp3BC
Emp3DE

 

Now, if Emp1 is viewing the report (Username() = "Emp1"), they'd see be able to see the following: 

EmployeeDepartmentSalaryLevel
Emp1AB1001
Emp2AB2002
Emp3BC1001
Emp4BC3002
Emp5BC4003
Emp6DEHiddenHidden
Emp7DEHiddenHidden

 

 

I tried implementing this using the following measure:

Filtering = 

VAR Employee = "Emp1" // Hardcoding for testing
VAR selValTable1 = VALUES('Salary Table')
VAR selValTable2 = Filter('Access Table', [Employee] = Employee)
RETURN
IF(INTERSECT(selValTable1, selValTable2), "", "Hidden")

 

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!

2 REPLIES 2
parry2k
Super User
Super User

@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. 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.