Forum Discussion
Member Filter based on List of Values
jennratten , I understand the second part of your code since it is very similar to what I did already. Will you please walk through the first part? Also, the varlist is very exact. Does it update automatically when variables are used?
Below is my output.
All names and GP/Locs are fictional.
- jennratten3 years ago
Super User
Hi mjohnston0209 sure thing. This top portion is just the code that is generated when you add a table to Power Query by typing it in.
My varList is specific because I was just making up an example to show you. It could be built with variables, though, using many different methods. If you are using Excel and trying to harvest the list from file data, you can do so with a named range, table column or sheet name and target range. If you are trying to use a list made up of values in GPLoc from your screenshot, you could do so like this:
let Source = Excel.CurrentWorkbook(){[Name="MyTable"]}[Content], GPLoc = Source[GPLoc] in GPLocLine 1 gets the table named MyTable from the current Excel workbook. Then Line 2 drills the table down to the GPLoc column, as a list. You could also do it in one step like this:
Source = Excel.CurrentWorkbook(){[Name="MyTable"]}[Content][GPLoc]