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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AdityaPowerBI
Helper II
Helper II

Traspose and flag column in a table

Hi,

 

I am trying to find a solution for below problem.  I want to replicate my input and add flag columns. Here is my data:

 

Col1 Col2 Col3 Col4 Col5

aa    bb     cc    dd     100
aa    bb     cc    ee      200
aa    bb     cc    ff      400

 

Output:

Col1 Col2 Col3 Col4 Col5 dd  ee ff

 aa    bb     cc    dd     100  Yes No No
aa    bb     cc    ee      200   No Yes  No
aa    bb     cc    ff      400    No No Yes

 

Thanks in advance.

1 ACCEPTED SOLUTION
DataZoe
Microsoft Employee
Microsoft Employee

@AdityaPowerBI In Transform Data, or Power Query, click on the Col4 and then choose Transform --> Pivot Column. (If you want both columns, you can right-click and duplicate the Col4 first, then pivot it.)

 

DataZoe_0-1607526510721.png

 

DataZoe_1-1607526548519.png

 

DataZoe_2-1607526563726.png

Let me know if that works for you!

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

View solution in original post

1 REPLY 1
DataZoe
Microsoft Employee
Microsoft Employee

@AdityaPowerBI In Transform Data, or Power Query, click on the Col4 and then choose Transform --> Pivot Column. (If you want both columns, you can right-click and duplicate the Col4 first, then pivot it.)

 

DataZoe_0-1607526510721.png

 

DataZoe_1-1607526548519.png

 

DataZoe_2-1607526563726.png

Let me know if that works for you!

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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