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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
rama211976
Regular Visitor

Required to calculate percentage for Clustered Column Chart with Multiple filters

Hi All,

 

I need to calculate the percentage (not the GT) for the report with multiple filter conditions. I could able to resolve this when having only one filter. the main requirement is the filter conditions should be considered as 100% and do the calculation but my logic considering the GT and getting the percentage wrong...

 

 

I have columns like

 

State   Gender   age group  salary range marriage status

 

In this, I need to calculate the percentage in the clustered column chart using state and marriage status as x and y axis

 

Filers are State   Gender   age group  salary range

 

sample data shared below

 

GenderAge GroupStatusRegionSalary
Male15-24UnMarriedCity 1Lower I 
Female15-24UnMarriedCity 2Middle I 
Male15-24DivorceCity 1Lower I 
Male15-24UnMarriedCity 3Middle II 
Female15-24UnMarriedCity 2Lower I 
Female15-24MarriedCity 1Lower II 
Male15-24UnMarriedCity 3Lower I 
Female15-24UnMarriedCity 1Lower I 
Male15-24UnMarriedCity 1Lower I 
Female25-34UnMarriedCity 1Lower I 
Female25-34UnMarriedCity 1Lower II 
Male25-34UnMarriedCity 4Middle II 
Male25-34UnMarriedCity 4Middle II 
Female25-34UnMarriedCity 1Middle II 
Male25-34UnMarriedCity 4Lower I 
Female25-34UnMarriedCity 4Middle II 
Female25-34UnMarriedCity 1Middle I 
Male25-34UnMarriedCity 1Lower I 
Male25-34UnMarriedCity 1Middle II 
Female25-34UnMarriedCity 3Lower I 
Female25-34UnMarriedCity 1Lower I 
Female25-34MarriedCity 5Middle I 
Female25-34UnMarriedCity 1Upper II 
Male25-34UnMarriedCity 3Lower I 
Male25-34UnMarriedCity 5Lower I 
Male25-34UnMarriedCity 1Lower II 
Male25-34UnMarriedCity 1Middle II 
Male25-34UnMarriedCity 1Middle II 
1 ACCEPTED SOLUTION

Hi, @rama211976 

According to your description, you want to realize it in "clustered column". Right?

Here are the steps you can refer to :

We can create a masure like this:

% = var _cur_count  = COUNTROWS('Data table')
var _cur_region=MAX('Data table'[Region])
var _total  =COUNTROWS( FILTER(ALLSELECTED('Data table') , 'Data table'[Region]=_cur_region))
return
DIVIDE( _cur_count ,_total)

And then we can put the measure on the visual and we can meet your need:

vyueyunzhmsft_0-1670830499784.pngvyueyunzhmsft_1-1670830510233.png

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

6 REPLIES 6
v-yueyunzh-msft
Community Support
Community Support

Hi, @rama211976 

According to your description, do you mean you want to see the percentage of the status per Satus?

If this , you just need to use the other visual "100% Stacked column chart" and put this on the visual.

vyueyunzhmsft_0-1670552006382.png

 

If this method does not meet your needs, you can provide us with your  desired output sample data in the form of tables, so that we can better help you solve the problem.

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

My requirement is clustered column chart where I need to display region on x axis and status on Y axis. I will have four filters Gender,Agegroup,region and score...

 

Status I have Marriage Unmarried and  Divorce

 

If I select all filters then it need to percent of status (total is 100%) for each individual regions.

 

If I select gender as Female then percent of status (total together should be 100%) for each individual regions. 

 

so the filter will become base as 100% and it needs to show the break of status for each region

 

I can share the excel copy for more understanding

 

https://drive.google.com/drive/u/0/folders/1EspAR9KFIjIArh7ZaPG7Pa0jDVGs699F 

Hi, @rama211976 

According to your description, you want to realize it in "clustered column". Right?

Here are the steps you can refer to :

We can create a masure like this:

% = var _cur_count  = COUNTROWS('Data table')
var _cur_region=MAX('Data table'[Region])
var _total  =COUNTROWS( FILTER(ALLSELECTED('Data table') , 'Data table'[Region]=_cur_region))
return
DIVIDE( _cur_count ,_total)

And then we can put the measure on the visual and we can meet your need:

vyueyunzhmsft_0-1670830499784.pngvyueyunzhmsft_1-1670830510233.png

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

 

pi_eye
Resolver IV
Resolver IV

Hi, can you elaborate on your requirements?

 

Dropping the fields you need into a stacked chart should result in the %'s adding up to 100.pi_eye_0-1670492991981.png

 

what's different that you need?

 

Regards,

 

Pi

My requirement is clustered column chart where I need to display region on x axis and status on Y axis. I will have four filters Gender,Agegroup,region and score...

 

Status I have Marriage Unmarried and  Divorce

 

If I select all filters then it need to percent of status (total is 100%) for each individual regions.

 

If I select gender as Female then percent of status (total together should be 100%) for each individual regions. 

 

so the filter will become base as 100% and it needs to show the break of status for each region

 

I can share the excel copy for more understanding

 

https://drive.google.com/drive/u/0/folders/1EspAR9KFIjIArh7ZaPG7Pa0jDVGs699F 

Hi @rama211976  can you grant me access to that excel? Thank you

 

Pi

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors