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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register 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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 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.