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.