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
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,980)