Forum Discussion
Performance issue at expanding or combining tablecolumn
- 6 years ago
Hi JVos,
you're right, sorry, my bad :(
Please read my new blog post, it should help with the performance: https://community.powerbi.com/t5/Community-Blog/Transitive-Closure-in-Power-Query/ba-p/782678
Hi JVos,
the code should look like the example below if you still use the solution from https://community.powerbi.com/t5/Power-Query/Recursive-query-to-derive-indirect-relationships/td-p/712958.
TableOfDescendents = Table.AddColumn(MainTable, "TableOfDescendents", each fnTransitiveRelationTable(MainTable, [ROUTING_ID_From])),
TableOfAllDescentantsTables = Table.Combine({MainTable, TableOfDescendents}),
If it is still slow, try the following:
TableOfDescendents = Table.Buffer(Table.AddColumn(MainTable, "TableOfDescendents", each fnTransitiveRelationTable(MainTable, [ROUTING_ID_From]))),
TableOfAllDescentantsTables = Table.Combine({MainTable, TableOfDescendents}),Hi Nolock,
Your proposal omits the indirect relations in the final result. Note that the initial code - in the solution you refer to - was:
TableOfDescendents = Table.AddColumn(ChangedType, "TableOfDescendents", each fnTransitiveRelationTable(ChangedType, [From])),
TableOfAllDescentantsTables = Table.Combine({ChangedType, Table.Combine(TableOfDescendents[TableOfDescendents])}),To see what happens step-by-step, I broke the last line into two lines of code:
TableOfDescendents = Table.AddColumn(ChangedType, "TableOfDescendents", each fnTransitiveRelationTable(ChangedType, [ROUTING_ID_From])),
CombinedDescendents = Table.Combine(TableOfDescendents[TableOfDescendents]),
TableOfAllDescentantsTables = Table.Combine({ChangedType, CombinedDescendents}),Now you propose in fact to remove to combine TableOfDescendents[TableOfDescendents], which makes that the indirect relations are not in the end result.
- Nolock6 years agoResident Rockstar
Hi JVos,
you're right, sorry, my bad :(
Please read my new blog post, it should help with the performance: https://community.powerbi.com/t5/Community-Blog/Transitive-Closure-in-Power-Query/ba-p/782678