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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
alex-JF
Frequent Visitor

How to transform grouped data?

Hi there, kinda difficult to explain what I want to get, therefore difficult to find something similar in forum, so I hope you can point me to the right stuff. To explain my point I'll prowide examples. Thank you in advance

Want to get:

john - mary,helga

bob - kate,alexa

smith - linda

 

Example source:

managercustomer
johnmary
bobkate
bobalexa
johnhelga
smithlinda
1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@alex-JF 
Please check the attached file

Fowmy_0-1703672364808.png

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

4 REPLIES 4
Fowmy
Super User
Super User

@alex-JF 
Please check the attached file

Fowmy_0-1703672364808.png

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

alex-JF
Frequent Visitor

many thanks it works!

123abc
Community Champion
Community Champion

To transform the grouped data in Power BI from the example source to the desired format, you can use the following steps:

  1. Load Your Data: Make sure you have loaded your data into Power BI. For this example, you'll have a table with columns named manager and customer.

  2. Group Data:

    • Go to the Home tab in Power BI.
    • Click on Transform data to open the Power Query Editor.
    • In the Power Query Editor:
      • Select the manager column.
      • Click on the Group By option in the ribbon.
      • In the dialog that appears, choose All Rows for the Operation and customer for the New column name. This will group the customers for each manager.
      • Click OK.
  3. Expand the Grouped Column:

    • After grouping, you will see a new column added, which contains lists of customers for each manager.
    • Click on the small double-arrow icon in the column header of the new column to expand the lists.
    • Choose to expand the lists into new rows.
  4. Clean Up Data:

    • You might end up with null values for some rows (like for the smith - linda row since there's only one customer). You can handle this by replacing null values with appropriate placeholders or by removing unnecessary columns/rows.
  5. Rename and Format:

    • Rename columns as needed. For instance, the grouped manager column might be renamed to just Manager, and the expanded customer column might be renamed to Customers.
    • You can further format or manipulate the data as required for your visualization or analysis.
  6. Close & Apply:

    • Once you're done transforming the data in the Power Query Editor, click on Close & Apply in the top-left corner to apply the changes and return to the main Power BI window.

After these steps, your data should be transformed to the desired format:

 

DEX

john - mary,helga
bob - kate,alexa
smith - linda

 

Now you can use this transformed data in your Power BI reports and visualizations as required.

 

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

 

In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.

I'm running into a problem:

alexJF_0-1703668944509.png

 

when I try to expand

I'm ending up with my previous table without summarisation customers

alexJF_1-1703669191184.png

what am I doing wrong? So when I'm trying to expand, I get new rows instead of new columns

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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