I'm not sure where I've missed understanding what you are trying to achieve so I'll go through the steps in a bit more detail.
First, make a table in your Excel worksheet with the criteria for the different rankings, you don't have to define Amber as it is between Red and Green. Give the table a name, I've used criteriaTable.
You can change the values and refresh later if you want.
You've already created a table with the raw data. I've named it dataTable.
Now go to Power Query and create a blank query. Go to Advanced editor and paste the following over the statements that are already there:
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Result", type text}, {"Red", type number}, {"Green", type number}})
I've called this criteriaTable, you need to edit the name.
Make another blank query and paste this over the code that appears by default, I have simplified the code so the conditional format can be accessed by double clicking on the conditionalColumn step:
unpivotOtherCols = Table.TransformColumnTypes(Table.UnpivotOtherColumns(removedColumns, {"Area"}, "Result", "Value"),{{"Value", type number}}),
mergedQueries = Table.NestedJoin(unpivotOtherCols,{"Result"},criteriaTable,{"Result"},"criteriaTable",JoinKind.LeftOuter),
expandedCriteriaTable = Table.ExpandTableColumn(mergedQueries, "criteriaTable", {"Red", "Green"}, {"Red", "Green"}),
conditionalColumn = Table.AddColumn(expandedCriteriaTable, "Ranked Group", each if [Value] >= [Green] then "Green" else if [Value] >= [Red] then "Amber" else if [Value] < [Red] then "Red" else null),
#"Changed Type" = Table.TransformColumnTypes(sortedResults,{{"Ranked Group", type text}})
Give the query a name and load it to the Data Model and close the editor.
Back in Excel create a Pivot table from the Data Model. You should get this if I have understood correctly what you are after:
| | | | | | | | | | | | |
| | | | | | | | | | | | |
Row Labels | Green | Amber | Red | Green | Amber | Red | Green | Amber | Red | Green | Amber | Red |
| | | | | | | | | | | | |
| | | | | | | | | | | | |
| | | | | | | | | | | | |
| | | | | | | | | | | | |
| | | | | | | | | | | | |
| | | | | | | | | | | | |
| | | | | | | | | | | | |
| | | | | | | | | | | | |
| | | | | | | | | | | | |
<colgroup><col style="mso-width-source:userset;mso-width-alt:4169;width:86pt" width="114"> <col style="mso-width-source:userset;mso-width-alt:1755; width:36pt" width="48" span="12"> </colgroup><tbody>
[TD="width: 114"]Average of Value[/TD]
[TD="width: 48"][/TD]
[TD="width: 48"][/TD]
[TD="width: 48"][/TD]
[TD="width: 48"][/TD]
[TD="width: 48"][/TD]
[TD="width: 48"][/TD]
[TD="width: 48"][/TD]
[TD="width: 48"][/TD]
[TD="width: 48"][/TD]
[TD="width: 48"][/TD]
[TD="width: 48"][/TD]
[TD="width: 48"][/TD]
[TD="colspan: 2"]Result 1[/TD]
[TD="colspan: 2"]Result 2[/TD]
[TD="colspan: 2"]Result 3[/TD]
[TD="colspan: 2"]Result 4[/TD]
[TD="class: xl65"]Canada[/TD]
[TD="class: xl66, align: right"]90.3[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66, align: right"]40.3[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66, align: right"]86.5[/TD]
[TD="class: xl66, align: right"]26.5[/TD]
[TD="class: xl66, align: right"]94.0[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66, align: right"]27.0[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66, align: right"]58.5[/TD]
[TD="class: xl65"]China[/TD]
[TD="class: xl66, align: right"]89.8[/TD]
[TD="class: xl66, align: right"]75.4[/TD]
[TD="class: xl66, align: right"]33.7[/TD]
[TD="class: xl66, align: right"]95.0[/TD]
[TD="class: xl66, align: right"]84.6[/TD]
[TD="class: xl66, align: right"]37.3[/TD]
[TD="class: xl66, align: right"]92.7[/TD]
[TD="class: xl66, align: right"]77.8[/TD]
[TD="class: xl66, align: right"]35.3[/TD]
[TD="class: xl66, align: right"]95.4[/TD]
[TD="class: xl66, align: right"]85.5[/TD]
[TD="class: xl66, align: right"]41.1[/TD]
[TD="class: xl65"]Croatia[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66, align: right"]58.0[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66, align: right"]62.0[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66, align: right"]55.5[/TD]
[TD="class: xl66, align: right"]95.0[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66, align: right"]22.0[/TD]
[TD="class: xl65"]France[/TD]
[TD="class: xl66, align: right"]86.2[/TD]
[TD="class: xl66, align: right"]71.0[/TD]
[TD="class: xl66, align: right"]37.0[/TD]
[TD="class: xl66, align: right"]95.0[/TD]
[TD="class: xl66, align: right"]83.4[/TD]
[TD="class: xl66, align: right"]43.4[/TD]
[TD="class: xl66, align: right"]94.5[/TD]
[TD="class: xl66, align: right"]77.5[/TD]
[TD="class: xl66, align: right"]39.9[/TD]
[TD="class: xl66, align: right"]95.5[/TD]
[TD="class: xl66, align: right"]83.3[/TD]
[TD="class: xl66, align: right"]42.3[/TD]
[TD="class: xl65"]Germany[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66, align: right"]24.7[/TD]
[TD="class: xl66, align: right"]96.0[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66, align: right"]34.0[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66, align: right"]35.7[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66, align: right"]82.0[/TD]
[TD="class: xl66, align: right"]10.5[/TD]
[TD="class: xl65"]Japan[/TD]
[TD="class: xl66, align: right"]87.3[/TD]
[TD="class: xl66, align: right"]70.0[/TD]
[TD="class: xl66, align: right"]48.0[/TD]
[TD="class: xl66, align: right"]95.0[/TD]
[TD="class: xl66, align: right"]83.0[/TD]
[TD="class: xl66, align: right"]42.5[/TD]
[TD="class: xl66, align: right"]88.0[/TD]
[TD="class: xl66, align: right"]77.2[/TD]
[TD="class: xl66, align: right"]17.2[/TD]
[TD="class: xl66, align: right"]94.0[/TD]
[TD="class: xl66, align: right"]80.0[/TD]
[TD="class: xl66, align: right"]39.2[/TD]
[TD="class: xl65"]Russia[/TD]
[TD="class: xl66, align: right"]91.0[/TD]
[TD="class: xl66, align: right"]76.3[/TD]
[TD="class: xl66, align: right"]37.1[/TD]
[TD="class: xl66, align: right"]96.1[/TD]
[TD="class: xl66, align: right"]86.0[/TD]
[TD="class: xl66, align: right"]42.4[/TD]
[TD="class: xl66, align: right"]90.3[/TD]
[TD="class: xl66, align: right"]75.2[/TD]
[TD="class: xl66, align: right"]32.7[/TD]
[TD="class: xl66, align: right"]96.2[/TD]
[TD="class: xl66, align: right"]88.0[/TD]
[TD="class: xl66, align: right"]45.5[/TD]
[TD="class: xl65"]United Kingdom[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66, align: right"]19.0[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66, align: right"]42.0[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66, align: right"]58.0[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66, align: right"]59.0[/TD]
[TD="class: xl65"]United States[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66, align: right"]79.0[/TD]
[TD="class: xl66, align: right"]34.0[/TD]
[TD="class: xl66, align: right"]100.0[/TD]
[TD="class: xl66, align: right"]88.0[/TD]
[TD="class: xl66, align: right"]43.7[/TD]
[TD="class: xl66, align: right"]92.5[/TD]
[TD="class: xl66, align: right"]80.3[/TD]
[TD="class: xl66, align: right"]25.6[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66, align: right"]85.0[/TD]
[TD="class: xl66, align: right"]39.2[/TD]
</tbody>