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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply

Delete unrelated data

 

Is there a way to delete unrelated data based on relationships?  For example, tableA comes from datasourceA.  TableB comes from datasourceB, but it has many records which are unrelated to tableA (the parent table).  Is there a way to easily delete the rows from tableB where there is no matching ID in tableA?

 

TableA contains all the IDs, TableB contains all the IDs in TableA (and some extra unnecessary and unwanted rows).  I figured if I deleted the unrelated rows in TabelB, I could shrink my file size because there are a bunch of unnecessary rows.  

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @kevlarmpowered,

 

For your requirement, I think you can also use advanced t-sql query to handling these unrelated records.

5.PNG

 

Reference links:

Selecting data from two different servers in SQL Server

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

 

Linked servers are not really an option... 

 

The solution of joining the tables within PowerBI works, with the added headache that it had to download the parent/related table each time you try to refresh the table in question.  So if you try to refresh TableB, it automatically includes TableA which means moving lots of data that may not have updated.

HI @kevlarmpowered,

 

Maybe you can write sub query to find out unrelated records id, then use these list as filter parameter to remove related records.

 

But I'm not so sure how to direct invoke those tables without link table, maybe you can try to create dataview based on other datasource, then operation on these views.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Vvelarde
Community Champion
Community Champion

@kevlarmpowered

 

Hi, In Query Editor. Merge Table B with Table A using the ID Column. Expand it (Select to expand only the ID )and Filter Unchecking the Null in this new Column.

 

Let me know if need more help

 

Regards

 

Victor

Lima - Peru




Lima - Peru

Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.