Forum Discussion

Rahulmg2002's avatar
Rahulmg2002
Frequent Visitor
3 years ago
Solved

unpivot table

Hello friends, 

I would like to unpiot m data in PowerBI . To explain it better i am attahcing images. please let me know how i can get this result an how. many thanks

 

 

 

 

  • Hi,

     

    you can do this with a few steps in power query,

     

    1. Duplicate your table
    2. Delete the response columns in table 1
    3. Delete the Item columns in table 2
    4. Unpivot the columns in both tables
    5. Add an index column to both tables
    6. Select the first table and merge queries with the 2nd table matching on the index column
    7. expand the table field and select only the attribute field
    8. delete the attribute and Index column from table 1
    9. Rename your columns Item and Response

    starting:

    Result:

     

     

    If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

     

2 Replies

  • DOLEARY85's avatar
    DOLEARY85
    Resident Rockstar

    Hi,

     

    you can do this with a few steps in power query,

     

    1. Duplicate your table
    2. Delete the response columns in table 1
    3. Delete the Item columns in table 2
    4. Unpivot the columns in both tables
    5. Add an index column to both tables
    6. Select the first table and merge queries with the 2nd table matching on the index column
    7. expand the table field and select only the attribute field
    8. delete the attribute and Index column from table 1
    9. Rename your columns Item and Response

    starting:

    Result:

     

     

    If I answered your question, please mark my post as solution, Appreciate your Kudos 👍