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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
v-ananyak
Employee
Employee

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 @v-jingzhan-msft 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

5 REPLIES 5
_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!




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 @v-jingzhan-msft 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!




It works! So much appreciated! Thank you!

Hi @v-ananyak , @v-jingzhan-msft ,

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.