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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cgoodale
Frequent Visitor

Percentage of Ratings For each Year

Hi, i am trying to show the ratings per year with a bar chart but can find the % of grand total. I want to show 

 

2019 

Rating 5 - 10%

Rating 4 - 20%

Rating 3 - 60%

Rating 2 - 5%

Rating 1 - 5%

 

Same for other years but I can only get the grand total %.

cgoodale_0-1594220572030.png

 

 

1 ACCEPTED SOLUTION

Good evening, I figured this out using three measures:

 

#1 - 

Annual Count =
CALCULATE (
COUNTROWS ( 'Consolidated 5 year' ),
ALLSELECTED ( 'Consolidated 5 year' ),
VALUES ( 'Consolidated 5 year'[YEAR] )
)
#2 - 
APFR Count =
CALCULATE (
COUNTROWS ( 'Consolidated 5 year' ),
ALLSELECTED ( 'Consolidated 5 year'[APfR_BusObj] ),
VALUES ( 'Consolidated 5 year'[APfR_BusObj])
)
 
#3 -
Annual % = CALCULATE(DIVIDE([APFR Count],[Annual Count]))
 
For #3 I had to change the Format to be in %s to show properly in the chart.
 

View solution in original post

9 REPLIES 9
Ashish_Mathur
Super User
Super User

Hi,

The measure should be something like this

=calculate([measure],allexcept(calendar,calendar[year]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi, would this also be 5 measures as a previous member indicated? I am very new to creating measures so I am struggling a bit to understand the concept.

It should be just one measure.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

This is what I inputted as one measure:

Per Year APfR = calculate(COUNTROWS('Consolidated 5 year'),allexcept('Consolidated 5 year','Consolidated 5 year'[YEAR]))
 
But i am getting a full count of the population in specific year and not based on the rating the employees were given. Each row could have the number 1, 2, 3, 4, or 5 in it. I need each of these subtotalled and then divided by the count for the specific year to get the % for the year. 
 
 
 
 

 

 

 
 
 
 

 

 

Hi,

Share a simple dataset and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Good evening, I figured this out using three measures:

 

#1 - 

Annual Count =
CALCULATE (
COUNTROWS ( 'Consolidated 5 year' ),
ALLSELECTED ( 'Consolidated 5 year' ),
VALUES ( 'Consolidated 5 year'[YEAR] )
)
#2 - 
APFR Count =
CALCULATE (
COUNTROWS ( 'Consolidated 5 year' ),
ALLSELECTED ( 'Consolidated 5 year'[APfR_BusObj] ),
VALUES ( 'Consolidated 5 year'[APfR_BusObj])
)
 
#3 -
Annual % = CALCULATE(DIVIDE([APFR Count],[Annual Count]))
 
For #3 I had to change the Format to be in %s to show properly in the chart.
 
ryan_mayu
Super User
Super User

@cgoodale 

I am not clear about your question. Are you looking for this?

1.png





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

Proud to be a Super User!




@ryan_mayuI am trying to show the percentage within the year. Each year would add to 100% rather than the percentage presented across the entire population. So the percentage would be isolated to each subset.

@cgoodale 

Did you create 5 measures ? If they are measures, they will be isolated in the each year.

 





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

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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