Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

View all the Fabric Data Days sessions on demand. View schedule

Reply
Luffy_kA
Frequent Visitor

Linking Bar Graph with Decomposition Tree with dynamic hierarchy

I have the data in the following format. I need a dynamic hierarchy which decomposition tree gives me and then I need two values one would be the distinct count of the key a each level of the hierarchy i.e. If I start with the model I need the distinct count of the key for the model selected on the decomposition tree. If model is the first level of teh hierarchy then i will have A,B,C and when A is selected on the decomposition tree then I need the count of the key for the model A. After this when I go to the next level as series and select 45. I need the distinct count of the key for Model A and series 45 and so on. 

The second value would be to get the distinct count of the similar keys present at the hierarchy level i.e. if I select the model as teh fisrst hierarchy and select A then the distinct count of similar key would be 1 since only the key abc is present in all the three series, similary when I go down the hierarchy I need the count to change so for example if i look at model A series 45 it has two verticals hence the distinct count of the similar items is 1 which is bcd. 

Once these two values are calculated, I need to have these values on the bar graph along with the decomposition tree such that, when I select the level 1 hierarchy I need the corresponding values of level 1 and when I select level 2 on decomposition tree I need the values of level 1 to remain same and alsp have the level 2 hierarchy beside it for comparison. 

Any help on how to achieve this would be appreciated. Also the bars of the decomposition tree should be based on the this

Currently these are the formulas that I am using to get the values

UN_Numerator (Distinct count of similar items) =
VAR A = CALCULATE(DISTINCTCOUNT(Table[Key],KEEPFILTERS(Table))

VAR B =  CALCULATE(DISTINCTCOUNT(Table[Key]),
CALCULATETABLE(
    FILTER(ADDCOLUMNS(Table,"ABC",COUNTROWS(FILTER(Table,EARLIER(Table[Key])=Tavle[Key]))),[ABC]=A)))
   
RETURN B

UN_Denominator (distinct count of all the items at the hierarchy) = CALCULATE(DISTINCTCOUNT(Table[Key]),KEEPFILTERS([Table]))


ModelSeriesVerticalKey
A4587abc
A4587bcd
A4598bcd
A1456esd
A1456efd
A1456fgd
A1456bgr
A2317abc
A2317cde
A2317ert
A2317yhf
A2317gfd
B1426abc
B1426abc
B1426bcd
B1426cde
B4554esd
B4554abc
B4554fgd
B4554bgr
C2310abc
C2310cde
C1420ert
C1420yhf
C1420gfd
1 REPLY 1
Luffy_kA
Frequent Visitor

@johncolley  I have seen there was a solution you have given for one of the question on a similar topic, any help how to customize this would be great.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors