Forum Discussion
BigMac
4 years agoRegular Visitor
Production structures - look for latest parent item while calculating usage for each level
Greetings, I have a table with given items divided from child to parent with usage per level. The diffiiculty is that child position is used in parent position, which becomes child position in an...
v-kkf-msft
4 years agoCommunity Support
Hi BigMac ,
If you want to find the top parent level, please create the following custom columns.
PATH =
let
mytable=#"Changed Type",p="Parent item",c="Child item"
in
let mylist={Record.Field(_,c)} & List.Generate(()=>[x=0,y=Record.Field(_,p),w=1],each [w] > 0,each [z=[y], x=Table.Column(Table.SelectRows(mytable,each Record.Field(_,c)=z),p),y=x{0},w=List.Count(x)
],
each [y])
in
Text.Combine(List.Reverse(List.RemoveItems(
List.Transform(mylist,each Text.From(_)),{null,""})),"|")Top Parent Level = Text.Start([PATH],9)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.