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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
pfeigl
New Member

Pivot data and change datatype based on type column

Ok, the title is a little complicated, but here goes the data I actually have:

 

pfeigl_0-1602779979157.png

 

I'd like to do two things

- pivot the result, so that the "ComponentNameModeSession" column is used as columns

- use the values in the "Type" column to change the datatype of the resulting columns

 

Is this possible? 

 

When doing the pivot, I get one row per "Type", because it can obviously not group on it. 

I can fix this, by removing the Type column first - this gives me the expected pivot result, however without the type column, I have no way to do the data transformation to actual dates, numbers and texts.

 

Thanks for your help,

Philipp

 

1 REPLY 1
edhans
Super User
Super User

I am not aware of a way to type the columns after they have been pivoted. They retain their pre-pivot types. You would need to change the type after it was done. If you know what the types need to be based on column name, I suppose you could use Expression.Evaluate or Expression.Identifier to do those change for you, but I would need some data to play with in a usable format.

 

How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.