Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

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.

  • Rydman Profile Picture
    96 on at
    Re: Flows - DIV function returns 0 when using Compose

    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!

  • trice602 Profile Picture
    13,817 Super User 2025 Season 1 on at
    Re: Flows - DIV function returns 0 when using Compose

    Hi @Julien5 ,

     

    Nice to see these replies on Friday!

     

     

  • Julien5 Profile Picture
    17 on at
    Re: Flows - DIV function returns 0 when using Compose

    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
    13,817 Super User 2025 Season 1 on at
    Re: Flows - DIV function returns 0 when using Compose

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

     

     

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Flows - DIV function returns 0 when using Compose

    Hi @trice602 

     

    Nice demonstration 👍

     

    Thanks

  • Verified answer
    ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Flows - DIV function returns 0 when using Compose

    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

  • Verified answer
    trice602 Profile Picture
    13,817 Super User 2025 Season 1 on at
    Re: Flows - DIV function returns 0 when using Compose

    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

     

     

     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1