Forum Discussion
polestar_11
2 years agoFrequent Visitor
Parent Child Hierarchy - Sum all Leafs on each NodeLevel
Hello everyone I hope you can help me with my Parent Child Hierarchy problem. I want to use a Dax measure to make the amount from the fact table (on hierarchy leaves) available on all node lev...
- 2 years ago
Hi polestar_11
You can try below measure.
Measure = SUMX( SUMMARIZE('Hierarchy','Hierarchy'[Name],'Hierarchy'[ID]), CALCULATE( SUM('Fact'[Amount]), TREATAS( CALCULATETABLE( VALUES('Hierarchy'[ID]), PATHCONTAINS('Hierarchy'[Path],EARLIER('Hierarchy'[ID])), ALL() ), 'Fact'[ID] ) ) )Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
xifeng_L
Super User
2 years agoHi polestar_11
You can try below measure.
Measure =
SUMX(
SUMMARIZE('Hierarchy','Hierarchy'[Name],'Hierarchy'[ID]),
CALCULATE(
SUM('Fact'[Amount]),
TREATAS(
CALCULATETABLE(
VALUES('Hierarchy'[ID]),
PATHCONTAINS('Hierarchy'[Path],EARLIER('Hierarchy'[ID])),
ALL()
),
'Fact'[ID]
)
)
)
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
polestar_11
2 years agoFrequent Visitor
That works perfect. What is the Reason that it doesn't work with a relation between the two tables? Is there a solution with a relation?