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
cevangelista
Frequent Visitor

Find the Latest Value

Hi there,

How can I find the latest value (Recruitment Stage)  for each ID number in the table below based on the Recruitment Stage date?

 

ID NoRecruitment StageRecruitment Stage Date
1LOO Issued14/05/2018
1LOO Accepted15/05/2018
4Medical Booked3/04/2018
3Medical Booked1/05/2018
3Medical Approved5/05/2018
5Medical Booked30/04/2018
5Medical Approved10/05/2018
5LOO Issued12/05/2018
5LOO Approved13/05/2018
7Phone Screen9/05/2018
7Medical Booked12/05/2018
11Site Referral14/05/2018
2Phone Screen2/05/2018
2Reference Checking9/05/2018
2Medical Booked12/05/2018

 

I would need the data to show this:

ID NoRecruitment StageRecruitment Stage Date
1LOO Accepted15/05/2018
4Medical Booked3/04/2018
3Medical Approved5/05/2018
5LOO approved13/05/2018

 

Thanks in advanced! 🙂

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

i created a calculated column using this DAX statement:

Is Latest = 
var currentIDNo = 'Table1'[ID No]
var latestDate = 
CALCULATE(
    MAX('Table1'[Recruitment Stage Date])
    ,FILTER(ALL('Table1')
        ,'Table1'[ID No] = currentIDNo
    )
)
return
IF('Table1'[Recruitment Stage Date] = latestDate, TRUE(), FALSE()) 

Here is a screenshot of the result (my assumptuon: the Recruitment Stage Date is of data type datetime or date). Please be aware that my table shows other dates, this is due some date formatting issues 🙂 but nevertheless I can use the statement on your table:

image.png

 

This column can now be used to filter the table.

 

Hopefully this is what you are looking for.

 

Regards

Tom 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

8 REPLIES 8
Sean
Community Champion
Community Champion

DELETED!

Thanks @Sean

 

It works except the date is all 31-Dec-18, did I type in something wrong?

 

2018-05-14_13-13-59.jpg

Can you post the measure formula you are using? Are you referencing the right date and in the right table?

Latest Recruitment Stage Date = CALCULATE (lastdate('MMW Recruitment (2)'[Recruitment Workflow Stage Date].[Date]), VALUES('MMW Recruitment (2)'[Candidate - FT ID No.]))

DELETED!

It works! Thank you so much.

 

If we wanted to use it in an axis for a chart, I can't use the measure can I?

 

 

TomMartens
Super User
Super User

Hey,

 

i created a calculated column using this DAX statement:

Is Latest = 
var currentIDNo = 'Table1'[ID No]
var latestDate = 
CALCULATE(
    MAX('Table1'[Recruitment Stage Date])
    ,FILTER(ALL('Table1')
        ,'Table1'[ID No] = currentIDNo
    )
)
return
IF('Table1'[Recruitment Stage Date] = latestDate, TRUE(), FALSE()) 

Here is a screenshot of the result (my assumptuon: the Recruitment Stage Date is of data type datetime or date). Please be aware that my table shows other dates, this is due some date formatting issues 🙂 but nevertheless I can use the statement on your table:

image.png

 

This column can now be used to filter the table.

 

Hopefully this is what you are looking for.

 

Regards

Tom 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Thank you @TomMartens!

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.