Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
2 years ago
Solved

Grouping multiple rows into one

An additional query appears to me as follows, there is some way for the assignee and requester data to appear in a single row and not two as shown.

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Syndicate_Admin ,

     

    Hope all is going well.

     

    According to your demand description, the same ID displays the assignee and requester data in one row. The most suitable method is pivot and unpivot. The operation steps are as follows:

     

    1. This is the original data, please change it according to your actual situation.

     

    2. Select the ID column in Power Query, select Transform>>Unpivot Columns>>click the drop-down box and select Unpivot Other Columns.

     

    After the operation is completed, the page should look like the following picture:

     

    3. Select the Attribute column in Power Query, select Transform>>Pivot Column, and select Value for "Values Column" in the pop-up window.

     

     

    After the operation is completed, the page should look like the following picture:

     

    Attached below are some official documentation links for you to learn more about Pivot and Unpivot.

    Pivot columns - Power Query | Microsoft Learn

    Unpivot columns - Power Query | Microsoft Learn

     

    Power BI Desktop files are attached.

     

    If you have any other questions, please feel free to contact me. I am very grateful for your patience and cooperation.


    Best Regards,
    Yang
    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Syndicate_Admin ,

     

    Hope all is going well.

     

    According to your demand description, the same ID displays the assignee and requester data in one row. The most suitable method is pivot and unpivot. The operation steps are as follows:

     

    1. This is the original data, please change it according to your actual situation.

     

    2. Select the ID column in Power Query, select Transform>>Unpivot Columns>>click the drop-down box and select Unpivot Other Columns.

     

    After the operation is completed, the page should look like the following picture:

     

    3. Select the Attribute column in Power Query, select Transform>>Pivot Column, and select Value for "Values Column" in the pop-up window.

     

     

    After the operation is completed, the page should look like the following picture:

     

    Attached below are some official documentation links for you to learn more about Pivot and Unpivot.

    Pivot columns - Power Query | Microsoft Learn

    Unpivot columns - Power Query | Microsoft Learn

     

    Power BI Desktop files are attached.

     

    If you have any other questions, please feel free to contact me. I am very grateful for your patience and cooperation.


    Best Regards,
    Yang
    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!