cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Timuran
Helper I
Helper I

Need Help - Show correct Percentage in pie chart

Hey,

 

I'm trying to display a pie chart of a measure depending on a category ([Top client All] by 'MARCHE_AGGREGE').

[Top client All] is a measure that calculate [CA client](another measure) with filter depending on others measure.

 

Timuran_0-1669286884862.png

 

[Top client All] = CALCULATE([CA client], INTERSECT(TOPN([NB Top CA],FILTER(DISTINCT(ALLSELECTED(CUBE_VUE_CLIENT[NUMCLI])), NOT ISBLANK([CA client])),[Rang CA],ASC), TOPN([NB Top NB Fac],FILTER(DISTINCT(ALLSELECTED(CUBE_VUE_CLIENT[NUMCLI])), NOT ISBLANK([CA client])),[Rang NB FAC],ASC)))

 

[CA client] = SUMX(CUBE_VUE_FAC_GLO, CALCULATE(SUM(CUBE_VUE_FAC_GLO[CA_LIGNE]), CUBE_VUE_FAC_GLO[NUMCLI]))

 

As you can see on my pie chart, the percentage should be for the MARCHE_AGGREGE -> 'Prive' around 78% ( 95,54k / 122.40k) but shows 63.46 %.

For the value it's correct.

 

It looks like the context disapear when it calculate the percentage.

 

Do you know how to keep the context ?

 

Hope you can help me,

Tim

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Timuran , Percentage is show based on the values in Pie and looking at the values- the % values seem correct

 

check if these can help


Dynamic Label
https://www.esbrina-ba.com/time-intelligence-dynamic-legend-in-line-charts/

 

Custom label
https://www.youtube.com/watch?v=IH4bcHhxunw



!! Microsoft Fabric !!
Microsoft Power BI Learning Resources, 2023 !!
Learn Power BI - Full Course with Dec-2022, with Window, Index, Offset, 100+ Topics !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Timuran , Percentage is show based on the values in Pie and looking at the values- the % values seem correct

 

check if these can help


Dynamic Label
https://www.esbrina-ba.com/time-intelligence-dynamic-legend-in-line-charts/

 

Custom label
https://www.youtube.com/watch?v=IH4bcHhxunw



!! Microsoft Fabric !!
Microsoft Power BI Learning Resources, 2023 !!
Learn Power BI - Full Course with Dec-2022, with Window, Index, Offset, 100+ Topics !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!

Hey @amitchandak, thank you for your reply.

 

The percentage is not correct, look below:

 

Timuran_0-1669289200085.png

I don't understand what's going on with the percentage but it calculcate on part of another total than my measure.

 

Do you know where the problem is?

 

Tilm

Helpful resources

Announcements
May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.

Top Solution Authors