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
geekmachine811
Frequent Visitor

Transposing Rows to Columns

Hi,

I would like to transpose some data. However, I am having challenges. Probably my approach is wrong. I am connected to a database that in my opinion was "poorly designed".

On an Excel sheet, data is in the format below:

geekmachine811_0-1676303018906.png

We can clearly see, the 3 columns (C, D & E). 

However, on one of the tables, all these records have been mashed up to one column "Value".

Is there a workaround ?

 

Below is my sql to the db.

geekmachine811_1-1676303194380.png

 

 

3 REPLIES 3
geekmachine811
Frequent Visitor

@Anonymous  Thanks. Find attached an Excel sample image. The first table is how the data currently seats. The second table is how i want it to reflect on BI. I am also attaching an image of the current relationship.

geekmachine811_1-1676360319878.png

 

 

geekmachine811_0-1676360199029.png

 

Anonymous
Not applicable

Hi @geekmachine811 ,

 

About transposing rows to columns, you can try pivotting column. Below is the example.

Sample data

vstephenmsft_5-1676356919242.png

 

The Attribute column should change to the column name, and the Value column should be the value in the attribute column.

Select the Attribute column and pivot as follows.

vstephenmsft_8-1676357011847.png

vstephenmsft_9-1676357035040.png

 

And then if you want to transform columns into attribute-value pairs, where columns become rows again, in addition to deleting existing steps, you can also unpivot columns. Select three columns and click "Unpivot Columns" under Transform.

vstephenmsft_3-1676356853281.png

vstephenmsft_4-1676356891931.png

 

It's still not clear what “segregate this as one record based on the first colmun "id"” in your new reply means.

In my current opinion, this is the Unpivot Column operation. If possible, please provide some sample data, as well as the expected results. Take care to protect your privacy.

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

 

 

geekmachine811
Frequent Visitor

I have managed to create each column by matching with its "id_form_field". Remaining task is, how do i segregate this as one record based on the first colmun "id"

geekmachine811_0-1676305412853.png

 

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.