Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
rpiboy_1
Helper V
Helper V

Dynamically Change Column Type by List

I'm able to dynamically rename a series of columns using List.Zip to zip together two columns from another table. The same table also contains the data type that should be applied in Power Query to the column (text, number, etc).

 

Is there a way I can do something similiar with Table.TransformColumnTypes? Nothing was jumping out to me as to how I could make the syntax work.

 

This is what the table looks like with the column data:

column.IDnamepq.datatype
2020Name1Text.Type
1011Name2Int64.Type
1212Name3Decimal.Type
1 ACCEPTED SOLUTION
wdx223_Daniel
Community Champion
Community Champion

=Table.TransformColumnTypes(YourTable,Table.ToList(YourTypeTable,each {_{1},Expression.Evaluate(_{2},#shared)}))

View solution in original post

2 REPLIES 2
rpiboy_1
Helper V
Helper V

@wdx223_Daniel thanks so much, worked perfectly!

wdx223_Daniel
Community Champion
Community Champion

=Table.TransformColumnTypes(YourTable,Table.ToList(YourTypeTable,each {_{1},Expression.Evaluate(_{2},#shared)}))

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.