Forum Discussion
KPI Score weighted average, unrelated table
- Anonymous2 years ago
Hi hnam_2006 ,
You can try the following steps:
1. Since your tables are not related, the first step is to create a merged table that brings together the KPI scores from all 6 tables.ConsolidatedTable = UNION ( SELECTCOLUMNS ( Table1, "Quarter", Table1[Quarter], "KPIScore", Table1[KPIScore], "SourceTable", "Table1" ), SELECTCOLUMNS ( Table2, "Quarter", Table2[Quarter], "KPIScore", Table2[KPIScore], "SourceTable", "Table2" ), ...... )
2. Once you have the merged table, you can calculate the weighted average of the KPI scores.WeightedAverageKPI = SUMX ( ConsolidatedTable, ConsolidatedTable[KPIScore] * ConsolidatedTable[Weight] ) / SUM ( ConsolidatedTable[Weight] )If the weights are different for each table, replace the column with the actual weight.
3. Finally, use the Power BI visual object to display the KPI scores and weighted averages for each quarter as required.
Best Regards,
Adamk KongIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi hnam_2006 ,
You can try the following steps:
1. Since your tables are not related, the first step is to create a merged table that brings together the KPI scores from all 6 tables.
ConsolidatedTable =
UNION (
SELECTCOLUMNS (
Table1,
"Quarter", Table1[Quarter],
"KPIScore", Table1[KPIScore],
"SourceTable", "Table1"
),
SELECTCOLUMNS (
Table2,
"Quarter", Table2[Quarter],
"KPIScore", Table2[KPIScore],
"SourceTable", "Table2"
),
......
)
2. Once you have the merged table, you can calculate the weighted average of the KPI scores.
WeightedAverageKPI =
SUMX (
ConsolidatedTable,
ConsolidatedTable[KPIScore] * ConsolidatedTable[Weight]
)
/ SUM ( ConsolidatedTable[Weight] )
If the weights are different for each table, replace the column with the actual weight.
3. Finally, use the Power BI visual object to display the KPI scores and weighted averages for each quarter as required.
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.