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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
juniorjfd
New Member

How to change the data label in a hierarchical tree chart

Hello everybody!

 

I received a request from a customer, in which she asked for the hierarchical tree data label to be changed, but I'm not getting it.

 

Basically, I need each step of the hierarchical tree to show as a data label, the percentage in relation to the total of the previous step.

 

Below is the chart. You can see that the data label contains the total for each category, but what I need is to show the percentage in relation to the previous step. For example, in the step "1ª Rechamada", in the first category "AGENDAMENTO REAPAR...", instead of showing the value "107", I need it to show "26.35%", that is, 107 of the current category divided by 406 of the previous step.

Can you help me?

 

 

image.png

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @juniorjfd 

 

For this you need a measure similar to the one below:

test = 
SWITCH (
    TRUE (),
    ISINSCOPE ( 'Table'[sub] ), DIVIDE ( [count], CALCULATE ( [count], ALLSELECTED ( 'Table'[sub] ) ) ) * 100 ,
    ISINSCOPE ( 'Table'[CAt] ), DIVIDE ( [count], CALCULATE ( [count], ALLSELECTED ( 'Table'[CAt] ) ) )* 100,
    [count]
)

 

Be aware that for this to work you need to have the order of the columns to be in the same order has the decomposition tred, if you change the order the values will be strange.

 

Another thing is what do you want to show on the first value is it the value or the percentage, has tyou can see my value is multiplied by 100 to get the value correct but it does not show the % value, we can do it with a use of the tabular editor to have a condittional formatting applied.

 

 

MFelix_0-1664300977003.png

 

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
juniorjfd
New Member

Thank you very much! It finally worked!

MFelix
Super User
Super User

Hi @juniorjfd 

 

For this you need a measure similar to the one below:

test = 
SWITCH (
    TRUE (),
    ISINSCOPE ( 'Table'[sub] ), DIVIDE ( [count], CALCULATE ( [count], ALLSELECTED ( 'Table'[sub] ) ) ) * 100 ,
    ISINSCOPE ( 'Table'[CAt] ), DIVIDE ( [count], CALCULATE ( [count], ALLSELECTED ( 'Table'[CAt] ) ) )* 100,
    [count]
)

 

Be aware that for this to work you need to have the order of the columns to be in the same order has the decomposition tred, if you change the order the values will be strange.

 

Another thing is what do you want to show on the first value is it the value or the percentage, has tyou can see my value is multiplied by 100 to get the value correct but it does not show the % value, we can do it with a use of the tabular editor to have a condittional formatting applied.

 

 

MFelix_0-1664300977003.png

 

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.