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 / Subtract minutes from ...
Power Apps
Answered

Subtract minutes from dropdown result - 14:00 - 20 mins to display 13:40

(0) ShareShare
ReportReport
Posted on by 11

Good morning all,

 

I'm a new user to Power apps, it's an amazing tool. I need a little help with a project I'm working on.

Basically I would like to use data from two drop down boxes ( Hours ) & (Minutes) & display as time in a separate box called (departure time) .  Can this be displayed as HH : MM ? 

Then I would like to have a series of display boxes that show the time that a task needs to be completed -20 mins before, -30 mins before, -5 mins before & so on until 0 mins would be the same as the original entered departure time.

 

 

 

Matt_G0101_0-1662430331346.png

 

Categories:
I have the same question (0)
  • Matt_G0101 Profile Picture
    11 on at

    So I've managed to get the time to display from my drop down boxes using - 

    TimeValue('STD Hours'.Selected.Value & ":" & 'STD Minutes'.Selected.Value)

     

    however my code  I'm using to display task times shows negative values in the boxes? Is this a format issue with the type of box? 

    Matt_G0101_0-1662432502874.png

     

     

     

  • v-bofeng-msft Profile Picture
    on at

    Hi @Matt_G0101 ,

     

    I've made a test for your reference:

    1\I assume there is a dropdown control-Dropdown-H

    Items

    Sequence(24,0,1)

    2\I assume there is a dropdown control-Dropdown-M

    Items

     

    Sequence(60,0,1)

     

    To get the result:

    With(
     {
     totalMins:Value('Dropdown-H'.SelectedText.Value)*60+Value('Dropdown-M'.SelectedText.Value),
     subMins:20
     },
     Text(RoundDown((totalMins-subMins)/60,0),"00")&":" &Text(Mod((totalMins-subMins),60),"00")
    )

    vbofengmsft_0-1662436286001.png

     

    Best Regards,

    Bof

     

  • Verified answer
    Matt_G0101 Profile Picture
    11 on at

    Far out Bof!! you are amazing!!! 

     

    With(
    {
    totalMins:Value('STD Hours'.SelectedText.Value)*60+Value('STD Minutes'.SelectedText.Value),
    subMins:20
    },
    Text(RoundDown((totalMins-subMins)/60,0),"00")&":" &Text(Mod((totalMins-subMins),60),"00")
    )

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard