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
Super User
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

 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


View solution in original post

1 REPLY 1
Expiscornovus
Super User
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

 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,801)