Forum Discussion
dahya_mistry
1 year agoFrequent Visitor
How to Refer to Tables and Table Name Variables in Custom Functions
I'm struggling with referencing Tables (as type table) and Tablenames (as type text) in a Custom Function. I have the following (part of a function) where the bolden items need to refer to the Table ...
dahya_mistry
1 year agoFrequent Visitor
That siounds like an interesting solution to be honest. I've tried creating a table as you suggested, but now I'm struggling to figure out how to refer to the Table in a function. So in your example, if I wanted to refer to the table #"Customer1", what PQ code can I use which will bring back the contents of that table as a table ?
eg do I do something like:
= #table[TableName] = "Customer1"
or something like:
= Table.SelectRows(....... ????)
will this bring back the contents of the Customer1 table ?
I'm still trying to learn PQ so some things aren't obvious to me yet !
PwerQueryKees
Super User
1 year ago#"Customer1"
It is that simple...