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
nachobarr2020
Regular Visitor

Dax measure percentage for a group

 

Hello dear community,

 

I hope you are ok. I need your assistance with the following. I have a bar chart that shows the ammount of people by gender and group age as shown in the image. The total ammount of people is 511 and for instance for the age group 45-49 the amount of females is 59, this is correct, this I do it by putting into the bar chart the variable GID (which is my id) and then display the count of them. However when I want to see the result as a percentage the results are not correct. Instead of showing for the given case 59/511= 11% it shows 6%. I would need maybe a measure in dax so that when I put in the x axis the age group and in the y axis the measure the % over the total is correctly displayed by gender (so in this case for instance 11% female and 9% male for the age group 45-49)

 

 

image power bi.png

image 4.png

 

Thank you in advance!!!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @nachobarr2020 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1699841375520.png

(2) We can create a measure. 

Measure = 
var _a= COUNT('Table'[gid])
var _b=CALCULATE(COUNT('Table'[gid]),ALL('Table'))
return DIVIDE(_a,_b,0)

(3) Then the result is as follows.

vtangjiemsft_1-1699841547472.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @nachobarr2020 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1699841375520.png

(2) We can create a measure. 

Measure = 
var _a= COUNT('Table'[gid])
var _b=CALCULATE(COUNT('Table'[gid]),ALL('Table'))
return DIVIDE(_a,_b,0)

(3) Then the result is as follows.

vtangjiemsft_1-1699841547472.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.