I have a complex expression I'm working with in Power Automate that has been causing some problems. I've narrowed the issue down to the part of the expression that uses the mod function. It produces the expected results if the dividend is not a negative number. When the dividend is a negative number, the result isn't as expected. For example, if in Power Automate I have this function
@maria3 It is evident that this is the case, the question is why ? Sharing a link for further reading and answer to why https://www.geeksforgeeks.org/modulo-operations-in-programming-with-negative-results/ . I believe yours is a classic case, for which you will not find in any power automate demo(no negative numbers in example). Therefore, I would recommend you to change the logic i.e do the mod operation in excel and pull the result in flow if you can.
Hope it helps!!
Cheers,
Ankesh
--------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
David_MA
10
Super User 2025 Season 1
Michael E. Gernaey
8
Super User 2025 Season 1
ankit_singhal
7
Super User 2025 Season 1