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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
kannanAhammed
Helper IV
Helper IV

Remove rows which contain data in another Table

Hi all,

 

I have a data set like below

Fact table

IDContent
1a
2b
3c
4d
6e
7f
8g

 

another table 

 

ID
2
3
4
5
8

 

Output as below

 

IDContent
1a
6e
7f

 

that is I want to remove all the rows which is in the 2nd table to be removed from the first. I prefer the rows to be deleted from the first table itself rather than doing a merge. 

2 ACCEPTED SOLUTIONS
TomMartens
Super User
Super User

Hey @kannanAhammed ,

 

I'm wondering why you don't want to use a merge?

 

Using Power Query the left-anti join is designed for exactly this use case.

If the data will be refreshed, the Power BI dataset, will only contain the remaining rows.

 

The next screenshot shows the merge dialog. 

image.png

After the merge (Left Anti) my simple fact table will look like this:

image.png

Then, of course, you can remove the column that contains the table, and it's done.

 

Hopefully, this provides what you are looking for.

 

Regards,

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

Jihwan_Kim
Super User
Super User

Picture1.png

 

New Table =
FILTER ( TableA, NOT ( TableA[ID] IN VALUES ( TableB[ID] ) ) )

 

 

Link to the sample pbix file 

 

 

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.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Picture1.png

 

New Table =
FILTER ( TableA, NOT ( TableA[ID] IN VALUES ( TableB[ID] ) ) )

 

 

Link to the sample pbix file 

 

 

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.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

TomMartens
Super User
Super User

Hey @kannanAhammed ,

 

I'm wondering why you don't want to use a merge?

 

Using Power Query the left-anti join is designed for exactly this use case.

If the data will be refreshed, the Power BI dataset, will only contain the remaining rows.

 

The next screenshot shows the merge dialog. 

image.png

After the merge (Left Anti) my simple fact table will look like this:

image.png

Then, of course, you can remove the column that contains the table, and it's done.

 

Hopefully, this provides what you are looking for.

 

Regards,

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
amitchandak
Super User
Super User

@kannanAhammed , do a left join in power query between 2 table and then delete all the rows which do have null value .

Or create this column and delete null rows in the merged table, assumed merged table has Table2.id

 

if [Table2.id] = null then null else 1

 

now delete null rows , option on right click

 

 

refer if needed

https://radacad.com/append-vs-merge-in-power-bi-and-power-query

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.