Greg_Deckler
Community Champion
7 years agoTransitive Closure
Nolock, wrote a fantastic article on Transitive Closure that you can read here. Great article, explains what transitive closure is, which I will not repeat here. The solution was presented in Power Q...
sevenhills
Super User
5 years agoTo test one more level, I added one more row to the data in your file as "From: 8, To: 9". Added second Measure to test 3 levels deep code.
it works! Great and Thanks Greg_Deckler
Destinations2 =
var _t1 = CALCULATETABLE( Distinct('Table'[To]), ALLEXCEPT('Table', 'Table'[From]) , NOT ISBLANK('Table'[To]) )
var _t2 = CALCULATETABLE( Distinct('Table'[To]), FILTER(all('Table'), [From] in _t1) )
var _t3 = CALCULATETABLE( Distinct('Table'[To]), FILTER(all('Table'), [From] in _t2) )
RETURN CONCATENATEX(
distinct( Union (_t1, _t2, _t3))
, 'Table'[To] ,";"
)
Regards