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 / Pick up dropdown value...
Power Apps
Answered

Pick up dropdown value based on sum filed

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello All,

I am trying to create a mileage log app. Employee can add their mileages.

You can see the screenshot below.

My question is this:

I have a filed called Total Mileage which summing up the total mileage column’s value.

The app retrieving data form SharePoint list.

When the Total Milage value is equal or less than 10.000, I want the payment option dropdown filed value to be/shown 0.45 option value otherwise the option value should be 0.25.

Total Mileage =Sum ('Mileage Log','Total Mileage')

Mileage Log is the list name in SharePoint.

If the total mileage=SUM (end mileage- start mileage)

Hope some of you would be able to come up with a solution.

Thank you in advance.

Kind RegardsMileage Screen.png

Categories:
  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

    Could you please tell me that how you set the Items property of the payment option dropdown?

    Do you want to filter the payment option dropdown filed value based on the Total Mileage result?

    Not sure about the column type of the Payment Option column, Choice or Text?

    I assume that it is a Choice column type, please check the following formula.

    Set the Items property of the payment option dropdown as below:

    If(Sum(TextInput_StartMileage.Text,TextInput_EndMileage.Text)<=10,
    Filter(Choices('Mileage Log'.'Payment Options'),Value="0.45"),
    Filter(Choices('Mileage Log'.'Payment Options'),Value="0.25")
     )
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Qi ,

    Thanks very much for your reply.

     

    The "Payment Options" is choose column/filed and has two values/options: 0.45 and 0.25. Please see the screenshot below.

     

    The total mileage text string is: Sum('Mileage Log','Total Mileage') and the name of the label is: LabelTotalMileage

     

    The following code is working but it hides one of the value (0.45 or 0.25) based on 600 and user still has to select the value from dropdown option.

     

    If(Sum('Mileage Log','Total Mileage')<=600,
    Filter(Choices('Mileage Log'.'Payment Options'),Value="0.45"),
    Filter(Choices('Mileage Log'.'Payment Options'),Value="0.25")
    )

    Is there any way, the value can automatically be populated into the filed rather than the user has to choose it.

     

    Thanks again.

     

    Mileage Screen.png

     

     

     

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

    Please try to set the DefaultSelectedItems property as below:

    If(Sum('Mileage Log','Total Mileage')<=600,
    Filter(Choices('Mileage Log'.'Payment Options'),Value="0.45"),
    Filter(Choices('Mileage Log'.'Payment Options'),Value="0.25")
    )
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks @Qi , That worked nicely. I assume that I do NOT need to "Set the Items property" value to.

     

    If(Sum('Mileage Log','Total Mileage')<=600,
    Filter(Choices('Mileage Log'.'Payment Options'),Value="0.45"),
    Filter(Choices('Mileage Log'.'Payment Options'),Value="0.25")
    )

     

    I can leave it as default value which is : Choices([@'Mileage Log'].'Payment Options').

     

    Best Wishes

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

    Generally, you could set the Items as

    Choices([@'Mileage Log'].'Payment Options')

    , and set the DefaultSelectedItems property as your If() statement.

    If your issue has been solved, please mark my solution as answer.

    Thanks for your co-operation.

  • Faizi Profile Picture
    12 on at

    I have a contract tracking sheet in Power Apps. I have 5 KPIs as drop down value types. and another data card which is Total Rating. I would like to sum the 5 KPIs and to show the total value of 5 KPIs in my Total Rating data card. What formula i should use?

    How to sum 5 KPIs drop down menus.JPG

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 383 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 356

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard