Forum Discussion
Filter table based on other table
- 10 years ago
thanks austinsense :-)
filter equal is easiest done by merging with JoinKind.Inner as described in these articles:
http://www.thebiccountant.com/2015/08/18/use-timeline-or-slicers-to-filter-your-power-query-import/
filter < is a bit different: There you have to use parameters. To do so you start filtering your table in the desired way by putting in a hardcoded value. After that you edit the resulting M-code and replace the hardcoded value by the parameter.
The parameter can be retrieved from a table by it's coordinates:
queryname[Columnname]{Rownumber-1}
So say your parameter sits in the first row the expression would be: Tableb[CurrMonth]{0}
Rownumber is zero because M starts to count with 0 (for the 1st row)
So this is how the parametrized filter would look like:
= Table.SelectRows(Source, each [Month] < Tableb[CurrMonth]{0})
That's not the expected behaviour.
I know this is stupid question (but I have no other idea): Are you sure that the following queries are actually referencing this query of did you develop them earlier by just copying the original query? Then you had to apply this filter there as well.
Yes, my 'previous' filter was interfering ... now fixed and working.
Thank you for your assistance - really appreciated!