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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
X19203659
Helper I
Helper I

Display the minimum employeeID based on the top ranking selected

Hi Community member

I would need to get your help to create a measure to get the EmployeeID with the smaller “_Tiebreaker rank” in a card visual.

As you can see in the below slicer called “Top”, “Top 10” is selected.
Based on this selection, the employee id Q00960 should appear in the card.

X19203659_0-1737999594686.png

 



Below are the different columns and measures that you can see on the above screenshot

Column:

EmployeeID column comes from the employee table

Measure

Measure 1

_MinEmployeeID is the below measure (Minx):

_MinemployeeIndex = MINX(Employee,Employee[EmployeeIndex])

Measure 2

8 _Select_Crt OnTime is the measure:

              8 _Select_Crt OnTime =

var MaxDate=  [MaxDate]

var MinDate=[MinDate]

var OnTimeTrip = COUNTX(filter(Duplicate_removed,

Duplicate_removed[is_point_tracked]=True

&& Duplicate_removed[mdc_driving_event_type]="Ontime"

&& Duplicate_removed[is_service_cancelled]<> true

)

, Duplicate_removed[UniqueTrip])

 

return

divide(OnTimeTrip,[0 _Select_Crt TrackedPoint])

 

Measure 3

 

EmployeeRank is the below measure:

EmployeeRank =

VAR BaseRank =

RANKX (

FILTER ( ALL ( Employee ), NOT ISBLANK ([8 _select_Crt OnTime] )),

 [8 _select_Crt OnTime],

, DESC, SKIP)

 

VAR TieBreakerRank =

                             RANKX (

FILTER ( ALL ( Employee ), NOT ISBLANK ([8 _select_Crt OnTime] )),

[_MinemployeeIndex],  -- Use EmployeeIndex directly, not SELECTEDVALUE

 ,  ASC,  SKIP)

 

VAR FinalRank =

IF (

ISBLANK([8 _select_Crt OnTime]),

BaseRank + 100000,  -- Push blank values to the bottom

BaseRank + (TieBreakerRank / 10000))

 

RETURN

FinalRank

 

Measure 4:

_TieBreakerRank =

 RANKX (

all(Employee),[EmployeeRank],

 , ASC, SKIP )

Many thanks in advance for your help!
Kind regards

 

1 REPLY 1
Anonymous
Not applicable

Hi @X19203659 ,

 

You want the top 1 Employee ID displaying in the card visual, right?

If so, please try

Top 1 EmployeeID = 
CALCULATE(
    MAX(Employee[EmployeeID]),
    FILTER(ALL(Employee), [_TieBreakerRank] = 1)
)

 

Best Regards,
Stephen Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.