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

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

Reply
akhaliq7
Post Prodigy
Post Prodigy

Is doing a right join to filter bad practice?

Hi I have found a useful method in filtering rows. If you right join merge a fact table with a lookup table then do a right join the lookup table being the first table then the lookup table is filtered to just contain the rows that are in the fact table (second table). This is quite beneficial as it stops the loading of 100,000s of rows. But my question is, is this good practice to follow or should I avoid using this way to filter tables.

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @akhaliq7 ,

 

I would strongly advise against using merges for anything that can be avoided.

 

For your scenario, i.e. creating dimension tables from fact tables, I would just create a new blank query something like this:

 

Table.Distinct(
    Table.SelectColumns(
        factQueryName,
        {"ID column name", "desciption column name"}
    )
)

 

 

If you just want to cut down a table based on values in another table, I would use a buffered list comparison, something like this:

 

Table.SelectRows(
    Table/QueryName,
    each List.Contains(
	    List.Buffer(referenceTable[columnWithFilterValues]),
	    tableToFilter[columnName]
    )
)

 

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
Anonymous
Not applicable

My opinion is that if both tables are in the same database, and there are key columns or it's at least decently indexed, it should be pretty efficient. It will still fold to the database. An inner join would be even more efficient, although that may not suit your needs. If your join columns are sorted ascending, you can use Table.Join and add the JoinAlgorithm.SortMerge, and it'll load in a flash.

 

Table.SelectRows using a distinct, buffered list is lighting fast as well. I say do whichever gets you there. But with a well maintained database, nothing is faster than SQL at joining data.

 

--Nate

BA_Pete
Super User
Super User

Hi @akhaliq7 ,

 

I would strongly advise against using merges for anything that can be avoided.

 

For your scenario, i.e. creating dimension tables from fact tables, I would just create a new blank query something like this:

 

Table.Distinct(
    Table.SelectColumns(
        factQueryName,
        {"ID column name", "desciption column name"}
    )
)

 

 

If you just want to cut down a table based on values in another table, I would use a buffered list comparison, something like this:

 

Table.SelectRows(
    Table/QueryName,
    each List.Contains(
	    List.Buffer(referenceTable[columnWithFilterValues]),
	    tableToFilter[columnName]
    )
)

 

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Kudoed Authors