cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
MAKroeze
Regular 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 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

 

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

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 )

vxinruzhumsft_0-1695867714173.png

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.

 

View solution in original post

3 REPLIES 3
MAKroeze
Regular Visitor

Hi Yolo Zhu,

That solved the challenge, thanks for the solution!

 

Best regards,

Michel

v-xinruzhu-msft
Community Support
Community Support

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 )

vxinruzhumsft_0-1695867714173.png

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.

 

v-xinruzhu-msft
Community Support
Community Support

Hi 

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors