Forum Discussion
Generate parent id from BOM level information
- 6 years ago
Anonymous
Your DAX formula also seems correct.
JUST REPLACE FIRSTNONBLANK with LASTNONBLANK
hi Anonymous
I am attaching the pbix file with Power Query Custom formulas
It works with me
Thanks, figured it out. You cannot just copy and paste those Power Query formulas because they have some reference to each step done with the data before.
Any ideas on how to generate the PATH directly in Power Query? Or how to generate the Level 1, Level 2, Level ..., Level n automatically? Since I do not know how many levels the data might include.
- Zubair_Muhammad6 years ago
Community Champion
Anonymous
In Power Query, we can use List.Generate to replicate the PATH function.
If you can copy paste some data with expected results, I will try to write it for you
- Anonymous6 years agoNot applicable
The expected result using DAX with the example you sent is just a new column with:
Column = PATH(BOM[Index]; BOM[Custom])
If this can be done with Power Query, then I can split the column to all the levels required without creating the columns manually and worrying if the level depth changes.
- Zubair_Muhammad6 years ago
Community Champion
Anonymous
You can use this custom column
I am attaching sample file with this formula
=let mylist= {[Index]} & (let myparent=[Custom] in List.Generate(()=>[x=0,y=myparent,w=1],each [w] > 0, each [z= [y], x=Table.SelectRows(#"Changed Type1",each [Index]=z)[Custom], y=x{0}, w=List.Count(x)],each [y])) in Text.Combine(List.Reverse(List.RemoveItems(List.Transform(mylist,each Number.ToText(_)),{null,""})),"|")