Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I am trying to do the reverse of what many others seem to be trying to do. I have an output of a list of parts that uses spaces to indicate what level they are at under the parent assembly above. I want to add a column that shows this relationship numerically, like I have in the example below.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wck4sUtJRMlSK1YlWUnDNS8/MSwXx9aAiCgGZxSX5eRAhuCBQFC6kZwQTDMrMS4eLGkNE3VMTi5LyK8DCMIUe+aXFMKVGcDNBKqFCQIWxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Part Name" = _t, Output = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Part Name", type text}, {"Output", type text}})
in
#"Changed Type"
hii @justlogmein ,
Can you please provide input in text format and output also so that I can understand the question?
All of the info is already there. The input is an indented list, so there are are a number of spaces until the words, which designate the level. The part's parent part is the one on the previous indentation directly above it. The output column I have included in the M code already above. It is a numbered list which outlines which parents it has come from.
You can see below that the Ring and Pin are under the Piston assembly, which are under the Engine assembly, which are under the Car assembly. And the Housing and Gear are under the Gearbox assembly, which is under the Car assembly.
Input:
Part Name
Car |
Engine |
Piston |
Pin |
Ring |
Gearbox |
Housing |
Gear |
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
68 | |
58 | |
42 | |
28 | |
22 |