Forum Discussion
Filtering table based on another table conditions in Power Query without merging tables
- 6 years ago
Hi israabuhasna ,
By my tests and research, you could try the power query below.
Table.SelectRows(#"Changed Type", each List.Contains(#"Table 2"[BuildingID],[BuildingID]))
Here is the output.
In addition, you also could download my test file and do a research.
Best Regards,
Cherry
Hi,
maybe this works without the if-condition:
Table.SelectRows(#"Filtered Rows1", each List.Contains(#"SiteSolutions T_BUILDINGS"[BUILDING_KEY],[BUILDING_KEY]))
I am trying to figure out this filtering technique as well for some stats at work.
My goal is to load a query based on the results from a pre-loaded first query's column.
Best
- israabuhasna6 years agoHelper I
No it won't work because some sources have the same BuildingID and I need to filter only for the source 'S2' since Table2 is only for source S2. Thank you for the response though.
- v-piga-msft6 years agoResident Rockstar
Hi israabuhasna ,
By my tests and research, you could try the power query below.
Table.SelectRows(#"Changed Type", each List.Contains(#"Table 2"[BuildingID],[BuildingID]))
Here is the output.
In addition, you also could download my test file and do a research.
Best Regards,
Cherry
- HotChilli6 years agoCommunity Champion
I think this version works. Please test with your data and field names
Table.SelectRows(#"Changed Type", each if [Source] = "S2" then List.Contains(#"Table 2"[BuildingID], [BuildingID]) else true)