Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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):
Date | Car1 | Car2 | Car3 | Car4 |
1/22/18 | FAST | SLOW | FAST | SOMEWHAT |
1/31/18 | SLOW | SLOW | FAST | SLOW |
Here's how I want to transform the data:
Date | Car | Speed |
1/22/18 | Car1 | FAST |
1/22/18S | Car2 | SLOW |
1/22/18 | Car3 | FAST |
1/22/18 | Car4 | SOMEWHAT |
1/31/18 | Car1 | SLOW |
1/31/18 | Car2 | SLOW |
1/31/18 | Car3 | FAST |
1/31/18 | Car4 | SLOW |
Anyone have any ideas????
Solved! Go to Solution.
That seems like a simple unpivot. Select your first column and unpivot other columns in Power Query.
That seems like a simple unpivot. Select your first column and unpivot other columns in Power Query.
User | Count |
---|---|
84 | |
78 | |
70 | |
46 | |
42 |
User | Count |
---|---|
106 | |
50 | |
49 | |
40 | |
40 |