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

Increment variable math formula

Hi all,

 

I have a flow I’m trying to make where I take an increment valuable and create a percentage. 
I have a flow for an evaluation SharePoint List where I’m trying to update some fields on a different SharePoint list that summarise the fields on the other list. 

 

I have successfully created a variable for the count, an average of a column, but now I’m trying to create a percentage of an occurrence of some values in a column. 

This column has 4 different possible values (Not at all Confident, Unsure, Confident, Very Confident). I want to find all the Confident and Very Confident for my percentage. I have successfully set up the condition and the output shows it is counting correctly. But then I am trying to then turn it into a calculation and falling short as the input and output is 0. Does anyone have any idea of how to help? 
See my flow below, I’ve circled in red the parts that I can’t get to work. 

F469DF79-DB18-472E-903A-C28B75D35391.jpeg

0AD6A4C2-FA06-49BE-A49F-4BFF29CACF6A.jpeg

69FF6209-A8C3-438F-ACF9-1FA9356451E0.jpeg

96707250-9281-49B7-B420-2059AC06B440.jpeg

 div(variables('Confidence'),outputs('ItemTotal'))

but also tried

mul(div(variables(‘Confidence’),outputs(‘ItemTotal’)),100)

D7A5BDBC-55C4-42C2-A105-D571D9C3B325.jpeg

8DD6B5E2-6D5F-46ED-9F32-9223164AAAF8.jpeg

 then the outputs:

working for increment

C286458F-986A-43FC-B4AF-56FD6B9BD599.png

 not working for compose 

A85E7D5B-59DF-43F6-85B9-1019D23D5BEC.jpeg

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @Lizzlenizzle,

 

Can you try and converting the integers to floats. For example try this expression in your compose action (with the name Division).

 

mul(div(float(variables('Confidence')),float(outputs('ItemTotal'))),100)


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

2 REPLIES 2
Expiscornovus
Super User
Super User

Hi @Lizzlenizzle,

 

Can you try and converting the integers to floats. For example try this expression in your compose action (with the name Division).

 

mul(div(float(variables('Confidence')),float(outputs('ItemTotal'))),100)


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


@Expiscornovus 

 

Amazing! It worked, thank you so much! Still getting used to using expressions so this was super helpful!!

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.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,118)