cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
fellipea_ao
Frequent Visitor

How create a measure to show percentage of a category per month in a stacked column chart?

Hello!

I'm trying to create a measure to show a percentage of category per month in stacked column chart.
First, I created a measure to show the percentage of total and showed it in tooltip:

 

%QTD_TotalCateg = 
var num = count('Planilha 1'[Aplicabilidade]) 
var denom = calculate(count('Planilha 1'[Aplicabilidade]), ALLSELECTED()) 
return divide (num,denom,0)

 

Ex: 2 "No" in April = 6.67% of total (2/30)

fellipea_ao_2-1658956172366.png

 

Now I want to know how to create a measure that show percentage of total of month to show in tooltip.

Ex: 2 "No" in April = 33.33% of total of April (2/6)

data: https://docs.google.com/spreadsheets/d/1ywn_YinYVXll-fFE0yBOdwr0ZWi1g_ek/edit?usp=sharing&ouid=10871...

 

 



1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@fellipea_ao 

pls try this. i didn't change the measure type, you can change it to percentage.

 

Measure = countx(FILTER('Table','Table'[Aplicabilidade]="No"),'Table'[Aplicabilidade])/CALCULATE(COUNT('Table'[Aplicabilidade]),ALLEXCEPT('Table','Table'[Mês]))

 

1.png

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@fellipea_ao 

pls try this. i didn't change the measure type, you can change it to percentage.

 

Measure = countx(FILTER('Table','Table'[Aplicabilidade]="No"),'Table'[Aplicabilidade])/CALCULATE(COUNT('Table'[Aplicabilidade]),ALLEXCEPT('Table','Table'[Mês]))

 

1.png

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you, its worked for me.

I ll use without the "filter".

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Vote for T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

March Events 2023A

March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors