Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Domenick
Helper IV
Helper IV

Evaluating by group and delivering average score

I'm trying to calculate average employee performance. For the sake of making this easier to explain, lets say employees have a number of tasks they need to complete weekly. The completion of those tasks is denoted weekly with a Yes (Y) or No (N). My intended result is the percentage of weeks where the employee completed all of the tasks. 

 

So I need to evaluate each group of tasks by date (I figure a 1 if all tasks are complete, a 0 if not all tasks are complete) and then I need to average those (which is the easy part). I've tried to illustrate that flow below:

Domenick_1-1658779994152.png

The part that I'm stuck on is evaluating each employees completion by date. I figure once I can get past that, averaging those ones and zeros will be easy.

 

Anyone have a good approach? It's probably very simple, and my brain is just fried.

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Domenick 
Please try

Score =
VAR SummaryTable =
    SUMMARIZE (
        Performance,
        Performance[Employee],
        Performance[Date],
        "@Completed", IF ( ISEMPTY ( FILTER ( Performance, Performance[Task] = "N" ) ), 1, 0 )
    )
RETURN
    AVERAGEX ( SummaryTable, [@Completed] )

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

Hi @Domenick 
Please try

Score =
VAR SummaryTable =
    SUMMARIZE (
        Performance,
        Performance[Employee],
        Performance[Date],
        "@Completed", IF ( ISEMPTY ( FILTER ( Performance, Performance[Task] = "N" ) ), 1, 0 )
    )
RETURN
    AVERAGEX ( SummaryTable, [@Completed] )

Thanks! It's not producing the correct result. I'm trying to figure out why. 

I got it to work! Thank you so much. Your code works brilliantly! 😊

@Domenick 
Try this please

Score =
VAR SummaryTable =
    SUMMARIZE (
        Performance,
        Performance[Employee],
        Performance[Date],
        "@Completed", IF ( ISEMPTY ( CALCULATETABLE( Performance, Performance[Task] = "N" ) ), 1, 0 )
    )
RETURN
    AVERAGEX ( SummaryTable, [@Completed] 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.