cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ericonline
Community Champion
Community Champion

Absolute numbers?

Hello,

How do I get the absolute value of a number?

Example:

sub(10,11)

Which equals -1. I need to get the absolute value of 1 from this statement. 
How can this be accomplished?
Thank you 

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @ericonline,

 

Unfortunately, there is no ABS function exist in Power Automate, as a workaround, you can determine it is whether less than 0, if it is, convert it to a string, then remove the "-" character, then convert it into an integer, for example:Annotation 2019-12-10 131824.png

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-litu-msft
Community Support
Community Support

Hi @ericonline,

 

Unfortunately, there is no ABS function exist in Power Automate, as a workaround, you can determine it is whether less than 0, if it is, convert it to a string, then remove the "-" character, then convert it into an integer, for example:Annotation 2019-12-10 131824.png

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ericonline
Community Champion
Community Champion

Just searched the forum for this topic (2021-01-12T16:23)... forgot I even asked it.

 

You know what the old timers say... "I've forgotten more than you'll ever learn about PowerPlatform". 

 

Iiiitts happeniiiing 🙂

v-litu-msft
Community Support
Community Support

It's so funny. Cheer up.

raf-avag_99
Advocate II
Advocate II

You can also wrap those numbers in max() min() and then calculate the difference:

sub(max(x,y),min(x,y))

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,853)