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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
kk1791
Frequent Visitor

Path error: Each value in [COMPONENTS] must have the same value in [PARENT]

Hello,

I am trying to create a calculated column using the PATH function: Path = PATH(COMPONENTS, PARENT). I am getting the error "Each value in [COMPONENTS] must have the same value in [PARENT]. The value '001:1200035:RS3016-007' has multiple values."

Any tips on how to solve this issue? 

SITE IDEND ITEMPARENTCOMPONENTSDESIRED OUTPUT PATH
0011200035 12000351200035
0011200035120003512035FRAME051200035/12035FRAME05
001120003512035FRAME058312035051200035/12035FRAME05/831203505
001120003583120350512035R-51200035/12035FRAME05/831203505/12035R-5
001120003583120350512035R1-21200035/12035FRAME05/831203505/12035R1-2
001120003512035R1-2RS3016-0071200035/12035FRAME05/831203505/12035R1-2/RS3016-007
001120003512035R-5RS3016-0071200035/12035FRAME05/831203505/12035R-5/RS3016-007
4 REPLIES 4
amitchandak
Super User
Super User

@kk1791 , Last two records have same component but different parent, that can the issue

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you for the response. My question is when there are multiple parents for components how to create a path? Any other options to overcome this?

Anonymous
Not applicable

Hi @kk1791 ,

It seems that there is no good solution to handle with it. The possible method is "remove" the duplicate value for the field [COMPONENTS] to avoid this error...I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can follow the below steps to get it:

1. Add new custom column in Power Query Editor 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjAwVNJRMjQyMDAwNsXKitUhoMrY1C3I0dfVAKdShAIdJQtjsAAOxQhZqMYgXWIVGuoa4bYfLKujFBRsbGBopmtgYI5Hqa4pmspYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"SITE ID" = _t, #"END ITEM" = _t, PARENT = _t, COMPONENTS = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"SITE ID", type text}, {"END ITEM", type text}, {"PARENT", type text}, {"COMPONENTS", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"COMPONENTS"}, {{"Count", each Table.RowCount(_), Int64.Type},{"Index", each Table.AddIndexColumn(_, "Index",1,1), type table}})//{{"Count", each Table.RowCount(_), Int64.Type},{"Index", each Table.AddIndexColumn(_, "Index",1,1)}, {"Details", each _, type table [SITE ID=nullable text, END ITEM=nullable text, PARENT=nullable text, COMPONENTS=nullable text]}})
,
    #"Expanded Index" = Table.ExpandTableColumn(#"Grouped Rows", "Index", {"SITE ID", "END ITEM", "PARENT", "Index"}, {"SITE ID", "END ITEM", "PARENT", "Index"}),
    #"Added Custom" = Table.AddColumn(#"Expanded Index", "NewComponents", each if [Count]>1 then [COMPONENTS]&"_"&Text.From([Index]) else [COMPONENTS]),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Count", "Index"})
in
    #"Removed Columns"

yingyinr_0-1660901136446.png

2. Create a calculated column as below to get the path

Column = PATH('Site'[NewComponents],'Site'[PARENT])

yingyinr_1-1660901233158.png

Best Regards

I tried your solution and it worked perfectly. Thank you for that. But when I try to run for all locations for the same End Item I am getting this error: The value '35SHRINK2' in 'BOM'[PARENT] must also exist in 'BOM'[NewComponents]. Please add the missing data and try again.

Could you please guide me on what should I do to fix this issue?

 

I am attaching the data link for reference: https://docs.google.com/spreadsheets/d/1Gzziln2BShPoVpeZm-ohKkcj_ctkPUBO/edit?usp=sharing&ouid=11116...

 

Thank you in advance

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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