Adjusting percentages in decomposition tree in Power BI

335 Views Asked by At

I was wondering if it's possible in Power BI to construct a decomposition tree in which the percentages assigned to each node are the contribution of that node to its parent node, rather than its contribution to the overall total. I've given a picture to show what I mean (it represents a budget allocated to some departments and sub-departments). I would like to obtain the bottom tree from the top tree. Thanks! enter image description here

1

There are 1 best solutions below

2
Sam Nseir On

Change the Bars > Options Scale to = Parent node.

enter image description here

Update
If you are wanting to display the percentages, then you will need to create a measure similar to this:

Tree% = 
  SWITCH(TRUE(),
    ISINSCOPE(Tree[L3]), DIVIDE([TreeSum], CALCULATE([TreeSum], ALLSELECTED(Tree[L3])) ),
    ISINSCOPE(Tree[L2]), DIVIDE([TreeSum], CALCULATE([TreeSum], ALLSELECTED(Tree[L2])) ),
    ISINSCOPE(Tree[L1]), DIVIDE([TreeSum], CALCULATE([TreeSum], ALLSELECTED(Tree[L1])) ),
    1
  )

Ensure the SWITCH statement starts with the lowest level of the tree.
[TreeSum] is a measure of SUM('yourTable'[relavant value])

enter image description here