web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Switch Function with B...
Power Apps
Answered

Switch Function with Between Values

(0) ShareShare
ReportReport
Posted on by 230

Hi - struggling to get this right, any thoughts?

 

Trying to take the value of a text input box and evaluate it using the switch funciton

 

Text(
 Switch(
 Value(SupportNeeded_23.Text),
 Value(SupportNeeded_23.Text) >= 0 && Value(SupportNeeded_23.Text) <= 10,
 0,
 Value(SupportNeeded_23.Text) >= 11 && Value(SupportNeeded_23.Text) <= 20,
 5,
 Value(SupportNeeded_23.Text) >= 21 && Value(SupportNeeded_23.Text) <= 30,
 8,
 Value(SupportNeeded_23.Text) > 30,
 11
 )
)
Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @tlevine ,

     

    A switch function only works for exact matches of the outcome of the formula (first argument): https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-if

     

    Instead of a Switch()function you need to use If():

    Text(
     If(
     Value(SupportNeeded_23.Text) >= 0 && Value(SupportNeeded_23.Text) <= 10,
     0,
     Value(SupportNeeded_23.Text) >= 11 && Value(SupportNeeded_23.Text) <= 20,
     5,
     Value(SupportNeeded_23.Text) >= 21 && Value(SupportNeeded_23.Text) <= 30,
     8,
     Value(SupportNeeded_23.Text) > 30,
     11
     )
    )
  • Verified answer
    tlevine Profile Picture
    230 on at

    thank you!!!!

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi  @tlevine ,

     

    Happy to read this resolved your issue. Can you please mark the right post as the solution so it's easier to find for other members of the community?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard