Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a report that I am trying to create via a dataflow, where I take a query result from SQL and transpose the data, but this leaves all the columns as an undefined type and the dataflow is wanting all the columns to be of a determined type. The number of columns will change month to month, so I can't explicitly convert them all to text, is there a formula or something I can use in the dataflow power query editor?
Solved! Go to Solution.
Found this post that seems to do the trick
Solved: Change data type of all columns in a table - Microsoft Fabric Community
let Source = Excel.CurrentWorkbook(){[Name="YourTable"]}[Content],
LSTHeaders = Table.ColumnNames(Source),
HowMany = List.Count(LSTHeaders),
Transformation = Table.TransformColumnTypes( Source, Table.ToRows(Table.FromColumns({LSTHeaders, List.Repeat({type number}, HowMany )})))
Found this post that seems to do the trick
Solved: Change data type of all columns in a table - Microsoft Fabric Community
let Source = Excel.CurrentWorkbook(){[Name="YourTable"]}[Content],
LSTHeaders = Table.ColumnNames(Source),
HowMany = List.Count(LSTHeaders),
Transformation = Table.TransformColumnTypes( Source, Table.ToRows(Table.FromColumns({LSTHeaders, List.Repeat({type number}, HowMany )})))
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 70 | |
| 58 | |
| 27 | |
| 22 | |
| 20 |