Forum Discussion
MAKroeze
3 years agoRegular Visitor
Calculate score per category using a score system
I have a dataset with multiple theme's. For each theme it shows the percentage of issues that were solved each month. Now I have to calculate a yearly score for each theme using the following sc...
- Anonymous3 years ago
Hi MAKroeze
You can refer to the following sample.
1.Create a calculated column in table.
Type = SWITCH ( TRUE (), [Percentage_issues_solved] >= 98, ">=98", [Percentage_issues_solved] >= 95 && [Percentage_issues_solved] < 98, ">=95 and <98", [Percentage_issues_solved] < 95, "< 95" )2.Then create a measure
Measure = VAR a = COUNTROWS ( FILTER ( ALLSELECTED ( 'Table' ), [Theme] IN VALUES ( 'Table'[Theme] ) && [Type] = ">=98" ) ) VAR b = COUNTROWS ( FILTER ( ALLSELECTED ( 'Table' ), [Theme] IN VALUES ( 'Table'[Theme] ) && OR ( [Type] = ">=95 and <98", [Type] = ">=98" ) ) ) VAR c = COUNTROWS ( FILTER ( ALLSELECTED ( 'Table' ), [Theme] IN VALUES ( 'Table'[Theme] ) && [Type] = "< 95" ) ) VAR d = COUNTROWS ( FILTER ( ALLSELECTED ( 'Table' ), [Theme] IN VALUES ( 'Table'[Theme] ) ) ) RETURN SWITCH ( TRUE (), a = d, 10, b = d, 7, b >= 2, 5, c >= 2, 0 )Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MAKroeze
3 years agoRegular Visitor
Hi Yolo Zhu,
That solved the challenge, thanks for the solution!
Best regards,
Michel