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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
qhpowerbi
Helper III
Helper III

Table Transformation

Hi all,

 

I'm currently having difficulties doing table transformation on power query. I have a table as below;
Question, answer, target date and status are seperated on different column.

qhpowerbi_0-1645341443728.png

 

 

I would like to transform the table, so it look like as below where Question, answer, target date and status group in proper column

qhpowerbi_2-1645339089175.png

 

Please advice me on how to do that on tranformation panel. Appereciate you guys help.
Thank you.

1 ACCEPTED SOLUTION
bcdobbs
Super User
Super User

1) Selected ID and Element and click Unpivot Other Columns. This gets:

bcdobbs_0-1645343281649.png

2) Select new Attribute column and click "Column from Example" >> "From Selection". Then on first row type the number of the question. It should work out the text formula to do the rest (click the top of the column and rename to Question before pressing ok):

bcdobbs_1-1645343397192.png

3) Select the Attribute column again and again click "Column from Example" >> "From Selection"

This time give an example of "Answer":

bcdobbs_2-1645343490353.png

4) Use choose columns to remove Attribute.

5) Click the new Headings column and click Pivot. Select the Value column for Values Column, expand Advanced options and tell it not to aggregate.

bcdobbs_3-1645343591339.png

6) Finished table:

bcdobbs_4-1645343646567.png

 



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

View solution in original post

2 REPLIES 2
qhpowerbi
Helper III
Helper III

Thanks @bcdobbs really appreciate your response 😀

bcdobbs
Super User
Super User

1) Selected ID and Element and click Unpivot Other Columns. This gets:

bcdobbs_0-1645343281649.png

2) Select new Attribute column and click "Column from Example" >> "From Selection". Then on first row type the number of the question. It should work out the text formula to do the rest (click the top of the column and rename to Question before pressing ok):

bcdobbs_1-1645343397192.png

3) Select the Attribute column again and again click "Column from Example" >> "From Selection"

This time give an example of "Answer":

bcdobbs_2-1645343490353.png

4) Use choose columns to remove Attribute.

5) Click the new Headings column and click Pivot. Select the Value column for Values Column, expand Advanced options and tell it not to aggregate.

bcdobbs_3-1645343591339.png

6) Finished table:

bcdobbs_4-1645343646567.png

 



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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