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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
BenHoward
Helper I
Helper I

Using DAX to remove invalid PATH rows

Hi, 

I'm using the PATH function in DAX to work out the hierarchy in an organsation, but as usual I have data quality issues which cannot be resolved in the source data.  My HR table has invalid parent data eg.

 

Emp NameEmpIDSupervisor ID
Amir11
Sharon21
John34

 

John has an invalid Supervisor ID.  How would I write DAX to create a new table where Supervisor ID is not in the EmpID column.  My resulting table would as follows, ie without the row containing the invalid supervisor ID.

 

Emp NameEmpIDSupervisor ID
Amir11
Sharon21

 

I should add I have 50k plus rows so something that's not hard coding the supervisorID would be great!

Thanks,  Ben.

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@BenHoward 

Create a new table:

New Table = 
	FILTER(
		Table1,
		Table1[Supervisor ID] IN ALL(Table1[EmpID])
	)

Fowmy_0-1622128289284.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
BenHoward
Helper I
Helper I

Fantastic, thank you.  One last question if I may, assuming my 1st table had 10 other columns, but I only wanted to return the 3 columns Emp Name, EmpId and Supervisor Id, how would I do that?  Thanks again!!

 

@BenHoward 

 

You can use SELECTCOLUMNS function 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Fowmy
Super User
Super User

@BenHoward 

Create a new table:

New Table = 
	FILTER(
		Table1,
		Table1[Supervisor ID] IN ALL(Table1[EmpID])
	)

Fowmy_0-1622128289284.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.