cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Learning_PApps2
Frequent Visitor

Power automate expression not returning float value

Hi ,

I have a power automate to calculate how much time spent on each stage by the user.  

I am using below expression to calculate the time in hours. 

add(div(div(sub(ticks(utcNow()),ticks(items('Apply_to_each_2')?['contactedstartdate'])),600000000),60),items('Apply_to_each_2')?['contactedage'])

If the user only spent 10 minutes in one stage and moved on to next the expression is returning 0. How do I get the result in float/decimal points. I tried float() added to each result and it still not returning values in decimal points. 

2 REPLIES 2
schwibach
Impactful Individual
Impactful Individual

2 things:

 

1. Have you tried making the ticks a float before the sub calculations? (my first bet)

2. Have you tried doing the ticks and sub calculations in compose actions giving them the correct data types?



__________________________________
Please mark topics as solved if they are and give kudos to make people happy 🙂
Always interested to hear about solutions/problems in the education sector.
Learning_PApps2
Frequent Visitor

I tried with float ( sub()) , but not float(ticks). So I will try that. 

In the compose action each function within the given expression is returning whole numbers even if I put float(div(<expression>), float(sub(<expression))

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,321)