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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
qwertzuiop
Advocate III
Advocate III

Calculate a grade based on satisfaction (If-Statement | Switch-Statement ?) in DAX

Hello dear Power BI Community

 

I hope you're all doing well so far.

I have the following problem:
Based on the measured satisfaction i would like to give a grade (from E-A)
<20 = E  |  >= 20 - <50 = D  |  50 = C  |  > 50 - <= 70 = B  |  >70 = A

How can I calculate my plan for a column in DAX?

 

satisfactiongrade
15.50E
20.00D
33.60D
50.00C
64.90B
70.00B
80.50A

 

Thank you very much for your contribution.
Have a nice day.

Cheers
qwertzuiop

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@qwertzuiop try following

 

Grade = 
SWITCH ( TRUE(),
[Satisfcation] > 70, "A",
[Satisfcation] > 50, "B",
[Satisfcation] >= 20, "C",
"E"
)




Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

4 REPLIES 4
parry2k
Super User
Super User

@qwertzuiop try following

 

Grade = 
SWITCH ( TRUE(),
[Satisfcation] > 70, "A",
[Satisfcation] > 50, "B",
[Satisfcation] >= 20, "C",
"E"
)




Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hello @parry2k 

 

Unfortunately your solution does not work for me.
At the moment I'm trying to configure your proposed solution, but at the moment I have no luck.

 

... 😞

@qwertzuiop ok you mentioned it is not working, but please explain what is not working? I have no idea without you explain it. Share sample data, what calculation you added, and how you are visualizing it, and what it is not working?

 

More detail you provide, the quicker the solution will be. 

 

Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k 

 

Excuse my absence.

You're solution is right but instead of "," I need to use ";".

Thank you very much for your support.
Cheers qwertzuiop

😊

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors