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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
craigpowell
Regular Visitor

Data refresh filter too slow

Hi All,

 

Very new (first post) to PowerBI, M and Dax. 

I am trying to filter at data refresh the lines included in the data load based on whether a value in one column exists in another column in another table.

I have two tables, StatePostcode and Address.  I have filtered the StatePostcode table to include only Victoria.

I now only want to load the rows in the Address table that relate to those Postcodes that exist in the StatePostcode table.  Each table has a Postcode column so I want to load only the rows in the Address table in which the Postcode in that row exists in the Postcode column in the StatePostcode table

I have mangaed to achieve what I want by creating a distinct query list (Postcodes) from the StatePostcode table and using it in the below filter however it is extreamly slow to the point I cannot use it in any actual application, but it (eventually) works.

 

= Table.SelectRows(_address, each List.Contains(Postcodes,[Postcode]))


Can anyone provide me with a better method/filter to achieve the same?

 

Thanks for any help.

 

1 ACCEPTED SOLUTION
MattAllington
Community Champion
Community Champion

  1. create a new query pointing to StatePostcode (call it Postcodes)
  2. Remove all colums other thatn postcode
  3. remove duplicates
  4. Set so it doesn't load.

 

  1. create a merge query starting with Address and join to Postcodes query from above
  2. left outer join
  3. expan the columns to extract the postcode from Postcodes.
  4. Filter on the new column where [postcode] <> null
  5. remove the extra postcode column.

you are done



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

3 REPLIES 3
rajulshah
Resident Rockstar
Resident Rockstar

Hello @craigpowell , 

 

I think using parameters will filter your table according to the PostCode entered.

 

Please let me know if you want to use parameters and filter the table.

 

If you dont want to use parameters,I'm afraid this solution won't be used.

 

Thanks.

MattAllington
Community Champion
Community Champion

  1. create a new query pointing to StatePostcode (call it Postcodes)
  2. Remove all colums other thatn postcode
  3. remove duplicates
  4. Set so it doesn't load.

 

  1. create a merge query starting with Address and join to Postcodes query from above
  2. left outer join
  3. expan the columns to extract the postcode from Postcodes.
  4. Filter on the new column where [postcode] <> null
  5. remove the extra postcode column.

you are done



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Cheers Matt.

 

Worked perfectly!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors