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 Automate / Flows - DIV function r...
Power Automate
Unanswered

Flows - DIV function returns 0 when using Compose

(1) ShareShare
ReportReport
Posted on by 17

Hi,

 

I'm going round in circles trying to figure out what I'm doing wrong. 

I have a variable figure that I want to divide by a fixed number but I can't get the formula to work as intended. The input shows as zero as shown in the flow results

 

Compose availability = div(outputs('Compose_-_Total_Task_Duration'),outputs('Compose_-_Availability_target'))
Julien5_0-1705068593449.png

 

The results of the flow

 

Julien5_1-1705068656675.png

 

thanks for taking the time to help.

Categories:
I have the same question (0)
  • Verified answer
    trice602 Profile Picture
    15,402 Super User 2025 Season 2 on at

    Hi @Julien5 ,

     

    You need to convert both values with float() to return the desired value, shown below.

     

    trice602_0-1705070995550.png

     

     

    trice602_1-1705071023705.png

     

     

     

  • Verified answer
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @Julien5 

     

    You need to convert both numbers to float (decimal numbers) and the perform div operation.

     

    Pls try the below expression:

    div(float(outputs('Compose_-_Total_Task_Duration')),float(outputs('Compose_-_Availability_target')))

    The above expression will return the results in decimal number.

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @trice602 

     

    Nice demonstration 👍

     

    Thanks

  • trice602 Profile Picture
    15,402 Super User 2025 Season 2 on at

    Hi @ManishSolanki ,

     

    Great job on your post too!  I like seeing us both in here at the same time.  I also learn a lot from you on posts I don't know the answer immediately; I always read your solutions and learn! 💯💯💯💯💯

     

     

  • Julien5 Profile Picture
    17 on at

    Thank you both for your help, I couldn't figure why the formula worked with fixed integers but failed initially.

    I made the changes and it worked nicely

  • trice602 Profile Picture
    15,402 Super User 2025 Season 2 on at

    Hi @Julien5 ,

     

    Nice to see these replies on Friday!

     

     

  • Rydman Profile Picture
    96 on at

    Hi,

     

    Thanks for  this. This little conundrum reminded me why it's so frustrating to code in Power Automate. Is there a comprehensive, yet concise, documentation where you could find this stuff? I've been coding for 40 years, yet I get stumped again and again by this kind of non-intuitive quirks. Thank God for the helpful community!

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard