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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
talbi
New Member

Row transform nested values in one column and their corresponding nested values in another column

Faced with the challenge of transforming the following input table using Power Query.

The expected, output table is listed below.

What would be the steps to achieve such transformation.

Thank you

 

Raw input dat table to import into Power BI

 

DepartmentsCitiesRegionsOfficesCountries
SalesNew Deli|Madrid|BrusselsNational Capital Region,Castilla Leon,Brussels Capital Region1,2,3India,Spain,Belgium
MarketingSan Francisco|Phoenix|Boulder|Boston|ParisCA,AZ,CO,MA,Île-de-Francea,b,c,d,eUS,US,US,US,FR

 

 

Input data format.PNG

 

Output Table:

Output data format.PNG

1 ACCEPTED SOLUTION
rsbin
Community Champion
Community Champion

@talbi ,

You can use a combination of the following:

Split Columns by Delimiter.  For the Cities column you would use "|", and for the others use ",".

Once Split, you can use the Unpivot Columns to get the Columns into Rows.

rsbin_0-1687369026661.png

Then use Filters or other Flags to Remove the unnecessary rows.  Unfortunately, ran out of time to complete the entire manipulation, but hoping this at least gets you started.

Have attached pbix what I started.

EDIT:   Found a better way.  Attached is a revised pbix file.  Please refer to PQ (2).  Have only done it for Sales, but hope you can see the pattern to replicate the process.

 

Kind Regards,

 

View solution in original post

1 REPLY 1
rsbin
Community Champion
Community Champion

@talbi ,

You can use a combination of the following:

Split Columns by Delimiter.  For the Cities column you would use "|", and for the others use ",".

Once Split, you can use the Unpivot Columns to get the Columns into Rows.

rsbin_0-1687369026661.png

Then use Filters or other Flags to Remove the unnecessary rows.  Unfortunately, ran out of time to complete the entire manipulation, but hoping this at least gets you started.

Have attached pbix what I started.

EDIT:   Found a better way.  Attached is a revised pbix file.  Please refer to PQ (2).  Have only done it for Sales, but hope you can see the pattern to replicate the process.

 

Kind Regards,

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.