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
ZEvans12
New Member

% of Grand Total that gives a letter grade based on %

So I have a pie chart that shows whether a student was on-time or late.  I have slicers that have school, day of week, etc.  I want to add a visual that updates depending on whatever slicers are selected and gives a letter grade.  

 

For example, if we look at a specific school on Monday, the students have a 99.85% on-time % then they should get an A.  But if you change the slicer to select another school and they have a 97.8% on-time % in the pie chart then the visual updates to show a C.

 

I know it's probably some type of measure, but I can't figure out the DAX.  Below are the %'s that align with letter grades

 

ZEvans12_0-1600353864316.png

 

Thanks

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

Hi  @ZEvans12 ,

 

It's avaiable to realize what you need.

But first pls advise me,based on the data you provided,how to get the result A if you select 99.85%?

 
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

 

AllisonKennedy
Super User
Super User

I'm not sure what the rest of your data looks like, but sounds like you want to do an approximate lookup to determine the letter grade.
https://excelwithallison.blogspot.com/2020/06/dax-approximate-lookup.html

Have you succeeded in calculating the percent based on slicer selection? If you have that working, then you can use DAX To do an approximate match to the letter grades table you have posted (which must also be loaded into Power BI).

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

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.