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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ConnieMaldonado
Responsive Resident
Responsive Resident

Filter SQL table based on another table at load time

Hello - This is probably easy to do, but I can't find any reference.

 

I'm loading a SQL table that has many columns, among them "Item"

 

Table1:  Items

Date

Work Order ID

Item

Tech_Name

Tech_ID

Etc...

 

I have another table that contains items which should be excluded from the first table.

Table 2: Item_Exclusions

Item

 

I want to filter the first table based on the second when the table is loaded.  I'm trying to avoid dealing with the filtering in my calculations.

1.  Is there any way to filter the table when it's loaded?

2.  If not, how do I filter the table after it's loaded so that I don't have to deal with the filtering in my report calculations?

 

Hopefully that makes sense.  Many thanks!!

1 ACCEPTED SOLUTION
ray_ux
Memorable Member
Memorable Member

you can, before you load the table in, write a sql statement that join table b to table a and applied filtered through the server side that way you won't have unnecessary data in the database.  IF you can't join the table before import then you can create a unique column within the power query editor and join to table A, but it will have all the data and you will have to manually apply filter, slicer for the visual.

View solution in original post

2 REPLIES 2
ConnieMaldonado
Responsive Resident
Responsive Resident

Ok, that makes sense.  I'll try eliminating the extraneous records on the SQL side.  Thank you!

ray_ux
Memorable Member
Memorable Member

you can, before you load the table in, write a sql statement that join table b to table a and applied filtered through the server side that way you won't have unnecessary data in the database.  IF you can't join the table before import then you can create a unique column within the power query editor and join to table A, but it will have all the data and you will have to manually apply filter, slicer for the visual.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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