cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Anonymous
Not applicable

Count the results of a measure

I have a measure to calculate a numeric grade and then convert that grade to a letter. I want to be able to count the occuronces of each letter. 

 

OverallGrade2 = 

If((Scores[GovernanceGrade] + Scores[SystemUtilizationGrade] + Scores[ServiceDeliveryGrade])/3>=90,"S",

IF(AND((Scores[GovernanceGrade] + Scores[SystemUtilizationGrade] + Scores[ServiceDeliveryGrade])/3<90,(Scores[GovernanceGrade] + Scores[SystemUtilizationGrade] + Scores[ServiceDeliveryGrade])/3>=80),"A",

IF(AND((Scores[GovernanceGrade] + Scores[SystemUtilizationGrade] + Scores[ServiceDeliveryGrade])/3<80,(Scores[GovernanceGrade] + Scores[SystemUtilizationGrade] + Scores[ServiceDeliveryGrade])/3>=70),"B",

IF(AND((Scores[GovernanceGrade] + Scores[SystemUtilizationGrade] + Scores[ServiceDeliveryGrade])/3<70,(Scores[GovernanceGrade] + Scores[SystemUtilizationGrade] + Scores[ServiceDeliveryGrade])/3>=60),"C",

IF(AND((Scores[GovernanceGrade] + Scores[SystemUtilizationGrade] + Scores[ServiceDeliveryGrade])/3<60,(Scores[GovernanceGrade] + Scores[SystemUtilizationGrade] + Scores[ServiceDeliveryGrade])/3>=40),"D",

If((Scores[GovernanceGrade] + Scores[SystemUtilizationGrade] + Scores[ServiceDeliveryGrade])/3<40,"F"))))))

 Ultimately, I want to create a slicer that I can then select one of those grades to filter out my table. Currently I can't do this. I tried a couple things I saw posted here but couldn't get them to work. One involved a sumx solution but that didn't seem to be right. 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

2 REPLIES 2
johnt75
Super User
Super User

Have a look at Slice by Categorical Measure 

Tutu_in_YYC
Resident Rockstar
Resident Rockstar

Look at this downloadable tutorial pbix. What you want to do requires creating a table with a Grade column to be used in a slicer. Then a measure with switch statement will "check" what you have selected in the slicer. And a visual filter will be filtering your visual to show you only the selected Grades.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors