Forum Discussion

MAKroeze's avatar
MAKroeze
Regular Visitor
3 years ago
Solved

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 scoring system.

One of the challenges is that multiple score categories can be true.

When that occurs, the lowest point should be assigned.

Any suggestion on how I can solve this?

 

Score system

  • 10 points: percentage solved >= 98 for all months
  • 7 points: percentage solved >= 95 for all months
  • 5 points: percentage solved >= 95 for two or more months
  • 0 points: percentage solved < 95 for more than 2 months

 

Mockup data:

ThemeMonthPercentage_issues_solved
A1-1-202393
A2-1-2023100
A3-1-2023100
A4-1-202395
A5-1-202395
A6-1-202393
A7-1-202394
A8-1-202394
A9-1-202394
A10-1-202394
A11-1-202398
A12-1-202399
B1-1-202399
B2-1-2023100
B3-1-202396
B4-1-2023100
B5-1-202398
B6-1-202398
B7-1-202399
B8-1-2023100
B9-1-2023100
B10-1-2023100
B11-1-2023100
B12-1-2023100

 

  • Anonymous's avatar
    Anonymous
    3 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.

     

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    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.

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi 

  • MAKroeze's avatar
    MAKroeze
    Regular Visitor

    Hi Yolo Zhu,

    That solved the challenge, thanks for the solution!

     

    Best regards,

    Michel