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 / Where do I post formul...
Power Apps
Unanswered

Where do I post formula questions?

(0) ShareShare
ReportReport
Posted on by

I need help formatting a formula that I want to use to make a table column that generates it's value based on the values in other columns of the data item.

 

I have basic JS training but I'm new to trying to write formulas in the power app environment.

 

Here's what I drafted:
(I have a lot of nested If statements at them moment so I apologize, it's messy.)

 

 

If(
 'Rate Type' = "In Person Rate - $49/hr"
 And 'Duration'<120
 And '2 hour minimum'="Yes"
 ((Duration+120)*Rate)
 If(
 'Rate Type' = "In Person Rate - $49/hr"
 And 'Duration'<120
 And '2 hour minimum'="No"
 (Duration*Rate)
 If(
 'Rate Type' = "In Person Rate - $49/hr"
 And 'Duration'>=120
 (Duration*Rate)
 )
 )
 )

If(
 'Rate Type' = "Virtual Rate - $44/hr"
 And 'Duration'<120
 And '2 hour minimum'="Yes"
 ((Duration+120)*Rate)
 If(
 'Rate Type' = "Virtual Rate - $44/hr"
 And 'Duration'<120
 And '2 hour minimum'="No"
 (Duration*Rate)
 If(
 'Rate Type' = "Virtual Rate - $44/hr"
 And 'Duration'>=120
 (Duration*Rate)
 )
 )
 )
If(
 'Rate Type' = "Contract Rate"
 Rate
)

 

 

 

What I'm trying to accomplish is to establish if the duration of an assignment was more or less than 2 hours, and if I opted to apply the 2 hour minimum. Depending on the answers to those 2 questions I want to calculate the total payment owed. There are 3 possible rate types. the question only applies for the rate types in person and virtual. Contract rate types are not hourly so it's a mute point.

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,798 Super User 2026 Season 1 on at

    Hi @coldgraphite ,

     

    I think the below would performs pretty much the same as what you describe:

     

    With(
    	{_Duration: If(Duration <120 && '2 hour minimum' = "no", Duration + 120, Duration),
    	If(
    		'Rate Type' = "Contract Rate", 
    		Rate,
    		_Duration * Rate
    	)
    )

     

     

    It uses a With function to do the evaluation of the duration and the '2 hour minimum' which can then be used in a single If statement. The if statement evaluates if the 'Rate Type is "Contract Rate" in which case only the Rate is returned, and in other cases the Rate, multiplied by the _Duration, as evaluated in the With function, is returned.

     

    This however will not work as it is, since the references to Duration, Rate, 'Rate Type' and '2 hour minimum' are not valid.

     

    Can you please share what you wish to use this formula for in order to support you with the correct references?

  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    hey @coldgraphite 

     

    you can also try this:

     

    Switch(
     'Rate Type',
     "In Person Rate - $49/hr",
     If(
     'Duration' < 120,
     If(
     '2 hour minimum'="Yes",
     (120 * 49),
     ('Duration' * 49 / 60)
     ),
     'Duration' * 49 / 60
     ),
     "Virtual Rate - $44/hr",
     If(
     'Duration' < 120,
     If(
     '2 hour minimum'="Yes",
     (120 * 44),
     ('Duration' * 44 / 60)
     ),
     'Duration' * 44 / 60
     ),
     "Contract Rate",
     Rate,
     0 // Default case if none of the above matches
    )
    

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 408

#2
timl Profile Picture

timl 340 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 319

Last 30 days Overall leaderboard