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
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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors