Forum Discussion
Format Data Labels to Show Total & Percentage
How can I format the data labels on my bar chart to show both the totals and the percentages?
Like this: 8 (7.21%)
Thanks!
Hi cchung3 ,
According to your description, here's my solution.
Sample:
Creat a measure:
Measure = SUMX ( ALL ( 'Table' ), 'Table'[Sales] ) & "(" & FORMAT ( DIVIDE ( MAX ( 'Table'[Sales] ), SUMX ( ALL ( 'Table' ), 'Table'[Sales] ) ), "#.00%" ) & ")"In the visual format pane>Data labels, turn on Costom label and put the measure in Field cell. Get the result:
I attach my sample below for your reference.
Best regards,
Community Support Team_yanjiang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- amitchandak
Super User
cchung3 , Try Measure driven data labels
https://powerbi.microsoft.com/en-us/blog/power-bi-may-2023-feature-summary/#post-23312-_Toc134425713
- v-yanjiang-msft
Community Support
Hi cchung3 ,
According to your description, here's my solution.
Sample:
Creat a measure:
Measure = SUMX ( ALL ( 'Table' ), 'Table'[Sales] ) & "(" & FORMAT ( DIVIDE ( MAX ( 'Table'[Sales] ), SUMX ( ALL ( 'Table' ), 'Table'[Sales] ) ), "#.00%" ) & ")"In the visual format pane>Data labels, turn on Costom label and put the measure in Field cell. Get the result:
I attach my sample below for your reference.
Best regards,
Community Support Team_yanjiang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.