Forum Discussion
Dynamic P&L Report from NAV Account Schedule
- 6 years ago
Hi Lucian
you can use my function to recursively solve this from here: https://www.thebiccountant.com/2017/02/14/dynamically-flatten-parent-child-hierarchies-in-dax-and-powerbi/
So first create a list of all items from the current row with my NAV-function that you've already found, expand and then use the above function to determine the levels / retrieve all parents.
Hello again,
Meanwhile I think I get "closer", but I still need help. It seems that the main problem is to transform the Accout Schedules table.
So I try to start from a simpler model:
So the problem is how could I replace formula lines with the Totaling values from the corresponding Row_No .
For example 10..12 should be replaced with 11100..11110|11300..11310|11500..11510
Basically something like this:
Splitting the Totaling and the "first level" formulas using the NAV.AccountListFromTotaling.pq from the article in the previous message I could solve it using a "self join" (maybe not the best option), but still remains one problem: The formula on the last line (please disregard the description from all of them).
In this case how could I convert
95|165 => 10..12|100..102 => 11100..11110|11300..11310|11500..11510|21200..21210|23200..23210|25000..25010
And this formula is "just" 2 levels but what if will be n levels?
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Invoked Custom Function" = Table.AddColumn(Source, "NAVSplit", each NAVSplit([Totaling], null, null)),
#"Expanded NAVSplit" = Table.ExpandListColumn(#"Invoked Custom Function", "NAVSplit"),
#"Added Conditional Column" = Table.AddColumn(#"Expanded NAVSplit", "LooukupFor", each if [Totaling_Type] = "Formula" then [NAVSplit] else ""),
#"Merged Queries" = Table.NestedJoin(#"Added Conditional Column", {"LooukupFor"}, #"Added Conditional Column", {"Row_No"}, "Added Conditional Column", JoinKind.LeftOuter),
#"Expanded Added Conditional Column" = Table.ExpandTableColumn(#"Merged Queries", "Added Conditional Column", {"NAVSplit"}, {"Added Conditional Column.NAVSplit"})
in
#"Expanded Added Conditional Column"
Any ideeas?
Kind Regards,
Lucian
- ImkeF6 years ago
Community Champion
Hi Lucian
you can use my function to recursively solve this from here: https://www.thebiccountant.com/2017/02/14/dynamically-flatten-parent-child-hierarchies-in-dax-and-powerbi/
So first create a list of all items from the current row with my NAV-function that you've already found, expand and then use the above function to determine the levels / retrieve all parents.