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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Need compare 20 fields...
Power Apps
Answered

Need compare 20 fields on lable to get the outcome

(0) ShareShare
ReportReport
Posted on by 24

We have 20 fields these are mix-match of radio button and dropdown(including multi-select) I use if to calculated result and store them in separate 20 label, and the result is these 4 strings: Low, Medium, High and Critical

12345678910
LowMediumHighCriticalMediumLowCriticalHighHighCritical
11121314151617181920
MediumLowCriticalLowHighCriticalMediumLowHighLow

 

The outcome will be the highest value available or presented on the above table which is Critical, even if we have 19 Low and 1 Critical it makes it to Critical.

 

Many thanks for your help in Advance

 

 

Categories:
I have the same question (0)
  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    I would make the Medium, High and Critical variables that you assign numbers to - 1,2 and 3.  Create a variable to hold the outcome - say var_FinalState, nad set the initial value to 1. Then each time a radio button or dropdown is changed you can compare the value that the control was just set to to the value of var_FinalState and set the new value to the greater of Var_FinalState or the control. That way it will always have the greatest value of any control. When all controls are adjusted yo will have the value you need.

  • erkindunya Profile Picture
    24 on at

    Thanks Brian, I thout about that, how do I compare the 20 variables?

  • Verified answer
    BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    The actual syntax will change slightly depending on the control, but say for a radio button,

    In the OnChange of each control put:

    If(var_FinalState<Radio.Selected.Value, Set(vaf_FinalState, Radio.Selected.Value))

    That will set var_FinalState to the larger of it's previous state or the radio button, whichever is larger

    Put that formula - or a similar one, depending on the control - in each OnChange event. Then no matter what order they change the controls var_FinalState will always have the greatest value.

    For your final value a statement like 

    Switch( var_FinalState,

          1, "Medium",

          2, "High",

          3, "Critical")

    Will get your text value for your final output

       

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard