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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
matthewtjy
Helper I
Helper I

Create Table By Excluding Rows From Another Table

Hi, I have currently two tables, Table1 and Table2.

Table1 is the main data set;
Table2 is derived from Table1 using filters to only include rows where TypeID="Personal"

i.e. Table2 =
FILTER(

'Table1',

'Table1'[TypeID]="Personal"
)

 

I would now like to create a new Table3 where it is also derived from Table1 but excludes rows where 'Table1'[WorkplaceID]='Table2'[WorkplaceID].

 

I have tried using the following formula but it doesn't work:

Table3 =
FILTER(
'Table1',
'Table1'[WorkplaceID]<>'Table2'[WorkplaceID]

 

Problem with the above formula is that I am unable to key in the column 'Table2'[WorkplaceID] into the formula.

 

Table1

WorkplaceIDChemicalIDTypeIDDate
AHydrochloric acidArea1 Jan 2012
ANitric acidPersonal5 Jan 2012
BHydrochloric acidPersonal2 Jan 2012
BHydrochloric acidPersonal6 Jan 2012
CSulphuric acidArea1 Jan 2012
CPotassium hydroxideArea3 Jan 2012
DMagnesium hydroxideArea4 Jan 2012
EPotassium hydroxidePersonal3 Jan 2012
FSulphuric acidArea5 Jan 2012

 

Table 2

WorkplaceIDChemicalIDTypeIDDate
ANitric acidPersonal5 Jan 2012
BHydrochloric acidPersonal2 Jan 2012
BHydrochloric acidPersonal6 Jan 2012
EPotassium hydroxidePersonal3 Jan 2012

 

[Desired Result] Table3

WorkplaceIDChemicalIDTypeIDDate
CSulphuric acidArea1 Jan 2012
CPotassium hydroxideArea3 Jan 2012
DMagnesium hydroxideArea4 Jan 2012
FSulphuric acidArea5 Jan 2012

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

For creating a new table.

 

Table3 =
FILTER ( Table1, NOT ( Table1[WorkplaceID] IN VALUES ( Table2[WorkplaceID] ) ) )


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

For creating a new table.

 

Table3 =
FILTER ( Table1, NOT ( Table1[WorkplaceID] IN VALUES ( Table2[WorkplaceID] ) ) )


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Works like a charm, thanks Jihwan!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.