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 Apps
Answered

undefined

(0) ShareShare
ReportReport
Posted on by 6

I am using a text label and in that text label I am using a formula which is converting numbers to hours and minutes.

And want to fill the color of text label according to hours number.

Like if text label is 8:00 then i want to fill label by green color.

Leo_yz_0-1671865483831.png

 

 

 

Categories:
  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    @Leo_yz ,

    What formula are you using to display the hours and minutes and what colour options do you want with the relevant times ?

  • Leo_yz Profile Picture
    6 on at

    I am using this formula: 

    With({inputMins:ThisItem.Mins},With({outputHrs:RoundDown(inputMins/60,0),outputMins:Mod((inputMins),60)},$"{outputHrs}{If(outputHrs>1 Or outputHrs<0 Or outputHrs=1 Or outputHrs=0,":")}{Text(outputMins,"00")}"))

    and if outputhrs is  8 then fill RGBA(218, 254, 187, 1)

  • Verified answer
    WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    @Leo_yz ,

    I assume you wrote that code ? If so, why the incredible over-complexity to simply turn minutes into hours and minutes display ? For the colour, all you really need to do is test Minutes/60 for the relevant hour.

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
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard