
Hi! I have a sharepoint list I am trying to figure out how to utilize power automate and flows to calculate a percentage score column that runs an initial calculation and then updates as new selections are updated or added. Each of the answers are text but are weighted differently based upon the answer. The answers consist of Yes (2/2), Partial (1/2), No (0/2), and N/A (0/0) and belong in choice columns. These answers will update as projects are completed. I also have two hyperlink columns that should score 1/1 with link present and 0/1 with no link. I have created a separate list with values but unsure what value to assign N/A since it shouldn't be counted against the total percentage and where to even begin this flow. TYIA. Any and all help is appreciated for this newbie.
@Anonymous I was unable to find an elegant solution to your problem, but after testing this does appear to work. I tried to cut down as much as I could, but I hope it helps.
I created two dictionaries for your variables. Compose is the scoring dictionary and Count is the dictionary to use when determining total possible points available.
I then ran an Apply to Each for each row in your SharePoint List. If you are only pulling one item at a time, the apply to each would not be necessary.
add(add(add(add(int(outputs('Compose')[item()?['Recommended']]),int(outputs('Compose')[item()?['Report']])),add(int(outputs('Compose')[item()?['Testing']]),int(outputs('Compose')[item()?['Training']]))),add(int(outputs('Compose')[item()?['KPIs']]),int(outputs('Compose')[item()?['Workflows']]))),add(if(greater(length(item()?['Link 1']),0),1,0),if(greater(length(item()?['Link 2']),0),1,0)))add(add(add(add(int(outputs('Count')[item()?['Recommended']]),int(outputs('Count')[item()?['Report']])),add(int(outputs('Count')[item()?['Testing']]),int(outputs('Count')[item()?['Training']]))),add(int(outputs('Count')[item()?['KPIs']]),int(outputs('Count')[item()?['Workflows']]))),2)mul(div(float(outputs('Totals')),float(outputs('Counts'))),100)| Link 1 | Link 2 | Recommended | Report | Testing | Training | KPIs | Workflows |
| www.google.com | Yes | Partial | N/A | No | Yes | N/A | |
| Partial | Partial | Yes | No | Yes | Yes |
| Recommended | Report | Testing | Training | KPIs | Workflows | Link 1 | Link 2 | Totals | Counts | Percentage |
| 2 | 1 | 0 | 2 | 1 | 0 | 6 | 10 | 60 | ||
| 1 | 1 | 2 | 0 | 2 | 2 | 0 | 0 | 8 | 14 | 57.14 |