Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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 )})))
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
45 | |
34 | |
32 | |
25 | |
23 |
User | Count |
---|---|
34 | |
33 | |
21 | |
20 | |
15 |