cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Helper II

## Ranking results of complex measure across employees.

Good Afternoon Experts,

I am looking to end up showing the results of a measure to an employee in the form of something like you are in the top 10/10/30/40 etc. % of employees (in terms of performance against target)

Performance agaisnt target is returned by:

Performance

VAR _flexitime = SUM('flexi UD_FullReport'[Day_TotalTime])
VAR _decimalHours = _flexitime / 60
VAR _dayValue = TIME(7,15,0) * 24
VAR _targetPerHour = _dayValue / [Target_IPD]
VAR _Target = ROUNDDOWN(_decimalHours / _targetPerHour,0)

RETURN

DIVIDE(COUNT(CompletedItems[WorkType]) - _Target, _Target)

I've been fiddling around all day and to be frank have got absolutely nowhere in terms of being able to then return the performance of the selected employee as a rank or even a decentile (think this is the correct word)  of all performances.
1 ACCEPTED SOLUTION
Solution Sage

@SACooper

Here's the results I get with the sample data, these measures and this model

Performance =

VAR _flexitime = SUM('flexi UD_FullReport'[Day_TotalTime])

VAR _decimalHours = _flexitime / 60 VAR _dayValue = TIME(7,15,0) * 24

VAR _targetPerHour = _dayValue / 43 // [Target_IPD]

VAR _Target = ROUNDDOWN(_decimalHours / _targetPerHour,0)

RETURN DIVIDE(COUNT('Completed Items'[WorkType]) - _Target, _Target)

Employee Rank = RANKX(ALL(ActiveDirectory[displayName]), [Performance])

11 REPLIES 11
Solution Sage

You can get the rank using RANKX

``Employee Rank = RANKX(ALL(Table[employee_id_column]), [Performance])``

Helper II

Hi @PaulOlding ,

Thank you for this, unfortuantely doesn't seem to work, its scoring everyone has 68 (the number of employees), I would have expected as I change the employee slicer that, this value would change. I have checked by placing another card with the performance to target value and this is changing to reflect the employee's performance correctly.

Solution Sage

Can you provide some example data in table form (ie not a screenshot)?

Helper II

Of course @PaulOlding, what would be most helpful a table of the performance results that the measure would calculate? or the tables that, that particular measure draws from?

Solution Sage

@SACooper the source data that the measure draws from.

see this post for more:

Helper II

OK @PaulOlding Here we go .....

ActiveDirectory
displayName | person.cn | user.mail | user.userPrincipalName | user.manager.displayName | user.manager.userPrincipalName

Scott Cooper | SCooper | scott.cooper@emailaddress.com | Joe Bloggs | joe.blogs@emailaddress.com
Jane Doe | JADoe | jane.doe@emailaddress.com | Joe Bloggs | joe.blogs@emailaddress.com
John Doe | JBDoe | john.doe@eamiladdress.com | Joe Bloggs | joe.blogs@emailaddress.com
...

Flexi UD_fullReport
prof_adlogin | ProfFullNameCached | Day_FlexiDayDate | Day_TotalTime
Scooper | Scott Cooper | 01/06/2022 | 435
JADoe | Jane Doe | 01/06/2022 | 420
JBDoe | John Doe | 01/06/2022 | 500
Scooper | Scott Cooper | 02/06/2022 | 450
JADoe | Jane Doe | 02/06/2022 | 475
JBDoe | John Doe | 02/06/2022 | 300
...

Completed Items
WorkType | ProcessedDate | ProcessedBy | Time
EMAILOUT | 01/06/2022 | SCooper | 09:11:31
EMAILIN | 01/06/2022 | JADoe | 08:45:16
ATLCHECK | 01/06/2022 | JBDoe | 09:21:16
SRDRED | 01/06/2022 | SCooper | 11:11:58
SRDRED | 02/06/2022 | JBdoe | 10:19:16
....

**currently target is a flat 43 items per day (7 hours 15 minutes) but this will be developed to be more dynamic taking into account departmental actvitity and would be stored for the user in the measure [Target_IPD]

Solution Sage

@SACooper

Here's the results I get with the sample data, these measures and this model

Performance =

VAR _flexitime = SUM('flexi UD_FullReport'[Day_TotalTime])

VAR _decimalHours = _flexitime / 60 VAR _dayValue = TIME(7,15,0) * 24

VAR _targetPerHour = _dayValue / 43 // [Target_IPD]

VAR _Target = ROUNDDOWN(_decimalHours / _targetPerHour,0)

RETURN DIVIDE(COUNT('Completed Items'[WorkType]) - _Target, _Target)

Employee Rank = RANKX(ALL(ActiveDirectory[displayName]), [Performance])

Solution Sage

Helper II

@PaulOlding Thank you it obviously works there must be something that I thought was unrelated, actually having an unintended influence ... i'll have a dig through ... chances are its in my data model somewhere.

Thank you for your time - really appreciate it.

Solution Sage

Solution Sage

Announcements

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

#### Power BI Monthly Update - May 2024

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

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors