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
rosscortb
Post Patron
Post Patron

Card showing wrong values

Hello,

 

I'm using a card to show employee's current position, therefore, I'm selecting Last and in some cases this works fine but for other employees it is showing their first position, any ideas where I am going wrong? I did some research and on another post suggested creating a mesure but this never worked either 

 

Position = SELECTEDVALUE('DB Headcount'[Position],BLANK())
 
Thanks
 
Ross
1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @rosscortb 

Is this problem sloved? 

If it is sloved, could you kindly accept it as a solution to close this case?

If not, please let me know.

 

Best Regards

Maggie

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @rosscortb 

Is this problem sloved? 

If it is sloved, could you kindly accept it as a solution to close this case?

If not, please let me know.

 

Best Regards

Maggie

v-juanli-msft
Community Support
Community Support

Hi @rosscortb 

Selecting "Last" works for me.

Capture3.JPG

Could you show me your scenario with some screenshots or example data?

 

 

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Using the "Last" aggregation will not always work as it does a CALCULATE(MAX( 'DB Headcount'[Position] )) so it will just the the alphabetically "last" position, not the last ordered by date.

 

To do that you would need to do something like the following assuming that you have EmployeeID and LastUpdatedDate columns (or something similar)

 

Current Position =
// get current employee VAR _employeeId = SELECTEDVALUE ( 'DB Headcount'[EmployeeID] )
// get the max updated date for that employee VAR _maxdate = CALCULATE ( MAX ( 'DB Headcount'[LastUpdatedDate] ), 'DB Headcount'[EmployeeID] = _employeeId )
// lookup the position for the employeeid and max date RETURN IF ( NOT ( ISBLANK ( _maxDate ) ), LOOKUPVALUE ( 'DB Headcount'[Position], 'DB Headcount'[EmployeeID], _employeeID, 'DB HeadCount'[LastUpdatedDate], _maxDate ) )

 

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.