cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
raneesh_mr
Helper I
Helper I

How to calculate percentage from difference in power automate

I'm trying to calculate percentage from two variable as below, please advice how to get the result as below.

 

raneesh_mr_0-1642579495744.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Dual Super User
Dual Super User

Hi @raneesh_mr,

 

You can convert the integers to floats in an expression. With the add and div functions you can calculate the result. With formatnumber you can turn it into a percent format (P).

 

Below is an example expression:

 

formatnumber(div(float(variables('TotalPass')), add(float(variables('TotalPass')),float(variables('TotalFailed')))), 'P')

 

 

percent_formatnumber.png

 

View solution in original post

1 REPLY 1
Expiscornovus
Dual Super User
Dual Super User

Hi @raneesh_mr,

 

You can convert the integers to floats in an expression. With the add and div functions you can calculate the result. With formatnumber you can turn it into a percent format (P).

 

Below is an example expression:

 

formatnumber(div(float(variables('TotalPass')), add(float(variables('TotalPass')),float(variables('TotalFailed')))), 'P')

 

 

percent_formatnumber.png

 

Helpful resources

Announcements
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.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (4,200)