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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Dennis08
New Member

Create new columns based on ther column values

Hi all, 

I have a question about creating columns. 

I have a csv file with 3 columns:

1) word
2) type
3) number

Example:

name yes /no number
dennis yes 41
james yes 28
dennis no 39
james no 39

I want to clean up the file, and create extra columns

name yes no
dennis 41 39

So basically, dedupe the names, and add the number values in seperate columns.


Thanks,
Dennis

3 ACCEPTED SOLUTIONS
HotChilli
Super User
Super User

Pivot the yes/no column.  It's in Power Query on the Transform tab

View solution in original post

dharmendars007
Solution Sage
Solution Sage

Hello @Dennis08 , 

 

To achive this you can use Power Query, Please lod the data in Power Query and follow the below steps.

 

1. In the Power Query Editor, make sure the columns are named as: word , type and number by double clinking on the cloumn header.

2. Select the type column (which contains "yes" or "no").

3. Go to Transform > Pivot Column

4.In the Values Column dropdown, select number

5. This will create two columns: one for "yes" and one for "no".

 

If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

 

 

View solution in original post

Kedar_Pande
Resident Rockstar
Resident Rockstar

Kedar_Pande_0-1728652566099.png

go to Transform Data to open Power Query Editor.

Select yes/no and click on pivot column > in the popup select values column as number.

Kedar_Pande_1-1728652735734.png

If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

View solution in original post

3 REPLIES 3
Kedar_Pande
Resident Rockstar
Resident Rockstar

Kedar_Pande_0-1728652566099.png

go to Transform Data to open Power Query Editor.

Select yes/no and click on pivot column > in the popup select values column as number.

Kedar_Pande_1-1728652735734.png

If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

dharmendars007
Solution Sage
Solution Sage

Hello @Dennis08 , 

 

To achive this you can use Power Query, Please lod the data in Power Query and follow the below steps.

 

1. In the Power Query Editor, make sure the columns are named as: word , type and number by double clinking on the cloumn header.

2. Select the type column (which contains "yes" or "no").

3. Go to Transform > Pivot Column

4.In the Values Column dropdown, select number

5. This will create two columns: one for "yes" and one for "no".

 

If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

 

 

HotChilli
Super User
Super User

Pivot the yes/no column.  It's in Power Query on the Transform tab

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.