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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

sum and Percentage label in Decomposition tree

want to have view like below e.i., sum and Percentage label in Decomposition tree

 

vananyak_1-1711533304270.png

 

Thanks in advance

1 ACCEPTED SOLUTION

Hi @Anonymous after some experimenting, I found a solution for this doing this:

1 - Change the data type to Text:

_AAndrade_1-1711983892208.png

 

2 - Use this measure on the dynamic format:

_AAndrade_0-1711983826263.png

VAR _Measure = COUNT('Table (2)'[Id])
VAR _Percentage = 
    [Percentage]
VAR _Result =
IF(
    _Percentage=1,
    "0" & " | " & FORMAT(_Percentage, "#%"),
    FORMAT(_Measure, "0") & " | " & FORMAT(_Percentage, "#%")
     )
RETURN
    _Result


My output was this:

_AAndrade_2-1711983973953.png

 







Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




View solution in original post

6 REPLIES 6
_AAndrade
Super User
Super User

Hi,

You can do it using Dynamic format for your measure, but you need to calculate that % number in order to display it.

You will find Dynamic format here:
 

_AAndrade_0-1711534429381.png


Take a look this video that show some examples how use dynamic format: https://www.youtube.com/watch?v=a3D7oXYjM9k







Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Anonymous
Not applicable

Hi @_AAndrade 

 

Thanks for this direction. I'm not able to realize it with dynamic format, can you help provide some guidance on this?

In the following image, the first part doesn't return correct result. When it doesn't include Percentage in the format, it is correct.

vjingzhanmsft_1-1711961448673.pngvjingzhanmsft_2-1711961481955.png

I don't know how to correct this. Can you help with this? Thanks in advance. 

 

Best Regards,
Jing

Hi @Anonymous after some experimenting, I found a solution for this doing this:

1 - Change the data type to Text:

_AAndrade_1-1711983892208.png

 

2 - Use this measure on the dynamic format:

_AAndrade_0-1711983826263.png

VAR _Measure = COUNT('Table (2)'[Id])
VAR _Percentage = 
    [Percentage]
VAR _Result =
IF(
    _Percentage=1,
    "0" & " | " & FORMAT(_Percentage, "#%"),
    FORMAT(_Measure, "0") & " | " & FORMAT(_Percentage, "#%")
     )
RETURN
    _Result


My output was this:

_AAndrade_2-1711983973953.png

 







Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Works like a charm. But there is still an issue with numbers which end with zeros.  For example, if the value if 520, instead of display it, the result show "5252000"

 

This persists with all values which end with zeros. Other numbers are all fine. And I am not able to find a solution for it too 🙂

Anonymous
Not applicable

It works! So much appreciated! Thank you!

Hi @Anonymous , @Anonymous ,

Did it solve your problem?
Did my message help you in any way? If it did, please mark my message as the solution and give it a "kudo", I'll appreciate it and help me out





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




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 Kudoed Authors