Forum Discussion
Using nested list to filter nested table
- 5 years ago
Hi MichaelHalling ,
you can try the following, otherwise please provide sample data:
Table.AddColumn(FilterListZC, "FilteredZC", each Table.SelectRows([Selected], (r) => List.Contains( FilterZC], r[TenorCode])))
Hi MichaelHalling ,
The best person to help you with this is ImkeF the best M language user in the community.
ImkeF can you please check this question.
- ImkeF5 years ago
Community Champion
Hi MichaelHalling ,
you can try the following, otherwise please provide sample data:
Table.AddColumn(FilterListZC, "FilteredZC", each Table.SelectRows([Selected], (r) => List.Contains( FilterZC], r[TenorCode])))- MichaelHalling5 years agoFrequent Visitor
ImkeFYou are amazing! That worked! Don't really know what r[TenorCode] does but it solved my problem. Also gotten a few helpful tips from your blog before this so a big THANK YOU for all your work. MFelix Thanks for caring 🙂
PS. You missed a '[ ' in [FilterZC] so for anyone reading this, this is the exact code that solved my problem.
Table.AddColumn(FilterListZC, "FilteredZC", each Table.SelectRows([Selected], (r) => List.Contains( [FilterZC], r[TenorCode])))
- ImkeF5 years ago
Community Champion
Hi MichaelHalling ,
very pleased to hear 🙂
And thanks for the correct code, I did mine on top of my head.With regards to r[Tenor]: There is a bit of syntax sugar in the M-language that obfuscates what's really going on:
- https://docs.microsoft.com/en-us/powerquery-m/understanding-power-query-m-functions