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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Split 1 Column to 3 Column based on parent

Hi, I have been looking at a problem that I have and I need to convert one column to multiple columns based on their parent.

 

Here is the data that I have;

LinkIDProduct.IdProductParent
11Tree 
12Apples1
13Big Leaves2
210Plane 
212Fuel 
214Wings10
216Flooring10
220Tail12
222Seats14
224Food14
224Staff20

 

And this is the result that I would like to get to;

LinkIDTopMiddleBottom
1TreeApplesBig Leaves
2Plane;FuelWings;Flooring;TailSeats;Food;Staff


It is best if I have this in the Power Query.

 

Thanks in advance!!

1 ACCEPTED SOLUTION

hi @Anonymous 

The formula is for calculated column, not custom column in edit queries.

7.JPG

Please download my sample pbix file and see the details in it.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

hi @Anonymous 

For your case, you could try this way as below:

Step1:

Add a conditional column that which row is Top, Middle, Bottom by this formula like below:

Type = var _toptable=CALCULATETABLE(VALUES('Table'[Product.Id]),ALLEXCEPT('Table','Table'[LinkID]),'Table'[Parent]=BLANK()) return
var _Middletable=CALCULATETABLE(VALUES('Table'[Product.Id]),FILTER(ALLEXCEPT('Table','Table'[LinkID]),'Table'[Parent] in _toptable) ) return
var _Bottomtable=CALCULATETABLE(VALUES('Table'[Product.Id]),FILTER(ALLEXCEPT('Table','Table'[LinkID]),'Table'[Parent] in _Middletable) ) return
IF('Table'[Product.Id] in _toptable,"Top",IF('Table'[Product.Id] in _Middletable,"Middle",IF('Table'[Product.Id] in _Bottomtable,"Bottom")))

1.JPG

Then use this formula to create a New table

New table = 
SUMMARIZE (
    'Table',
    'Table'[LinkID],
    "Top", CALCULATE (CONCATENATEX ( VALUES ( 'Table'[Product] ), [Product], "," ), FILTER ( 'Table', 'Table'[Type] = "Top" )),
    "Middle", CALCULATE (CONCATENATEX ( VALUES ( 'Table'[Product] ), [Product], "," ),FILTER ( 'Table', 'Table'[Type] = "Middle" )),
    "Bottom", CALCULATE (CONCATENATEX ( VALUES ( 'Table'[Product] ), [Product], "," ),FILTER ( 'Table', 'Table'[Type] = "Bottom" ))
)

Result:

2.JPG

and here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-lili6-msft 

 

All looking good, I have started to follow your steps but when I am creating the custom column I get the below error;

 
 

image.png

 

Thank you for your help

hi @Anonymous 

The formula is for calculated column, not custom column in edit queries.

7.JPG

Please download my sample pbix file and see the details in it.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Great, yes I see now thank you very much and it all worked 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors