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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
avocados12345
Frequent Visitor

Data Transformations similar to "melt" column combining in R?

Hello,

 

I have a data source with many columns, each indicating a status. For all columns, the possible types of statuses are the same. What I want to do is merge all the responses for each column into a single column, and make my column headers into a variable. I want to do what the melt function achieves using the reshape2 package in R. 

 

Here's an example (except I have about 30 columns):

DateCar1Car2Car3Car4
1/22/18FASTSLOWFASTSOMEWHAT
1/31/18SLOWSLOWFASTSLOW

 

Here's how I want to transform the data:

 

DateCarSpeed
1/22/18Car1FAST
1/22/18SCar2SLOW
1/22/18Car3FAST
1/22/18Car4SOMEWHAT
1/31/18Car1SLOW
1/31/18Car2SLOW
1/31/18Car3FAST
1/31/18Car4SLOW

 

Anyone have any ideas???? 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

That seems like a simple unpivot. Select your first column and unpivot other columns in Power Query.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

That seems like a simple unpivot. Select your first column and unpivot other columns in Power Query.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Perfect. Thank you!

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.