Forum

Filter a table base...
 
Notifications
Clear all

Filter a table based on a List Query

2 Posts
2 Users
0 Reactions
110 Views
(@optimaoffice)
Posts: 17
Eminent Member
Topic starter
 

Hi,

I have a table with P&L data and i need to filter out certain account names. See Raw Data tab. I have a table of all the account names that should be filtered out (tab Filter List). I loaded the filter list to a query and converted it to a list. I ensured that the type of the list records is Text. Then i created a Query called PL that pulls the table from the Raw Data tab and that is supposed to filter out any records matching the Filter list (GLTotals query). I am not getting an error message, but the list is not being filtered at all (see tab PL). I am not sure why this does not work. The Data Types match, i used the Trim function in Excel to ensure that there are no extra spaces and it still does not work. ChatGPT could not figure it out either 🙂 Any help is appreciated. File is attached.

 

Thanks,

Dana

 
Posted : 29/06/2023 11:18 pm
Riny van Eekelen
(@riny)
Posts: 1185
Member Moderator
 

Use this line of code to filter the RowData based on a list.

Table.SelectRows(#"Changed Type", each List.Contains (GLTotals, [RowData]))

Read more about it in the article in the link below:
https://exceloffthegrid.com/power-query-filter-list/

Perhaps you're better off by using Merge as that seems to work faster. It's mentioned towards the end of the article.

 
Posted : 30/06/2023 12:03 am
Share: