Forum Discussion
edhans
Community Champion
7 years agoHas anyone been able to reliably use Table.ColumnsofType() in Power Query?
I get random success/failures with this function. I have a table called Sales with several columns - number, text, Int64.Type, etc. The following in a new query returns nothing in the list. No er...
Stachu
Community Champion
7 years agoit seems it only recognises the primitive types as per language specification
https://msdn.microsoft.com/en-us/query-bi/m/power-query-m-language-specification
if you look in #shared, and filter for .Type, as below
let
Source = #shared,
#"Converted to Table" = Record.ToTable(Source),
#"Filtered Rows" = Table.SelectRows(#"Converted to Table", each Text.EndsWith([Name], ".Type"))
in
#"Filtered Rows"you can see that all the Int64, Currency etc. all have type number, which I assume is what the function is getting
edhans
Community Champion
7 years agoInteresting. That is helpful as to when it works why it works the way it does. The documentation needs to specify this IMHO. I would try the "Contribute" feature to add this, except I cannot get it to work consistently, as in the empty list in my example above.