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

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

Reply
Atseaukes
Frequent Visitor

Return value based on latest date-time and ID

Hi all,

 

I have the follow example set 'Events Completion':

user_iddatetimesubject_title
14166-8-201809:37:02Session 1 A
14166-8-201809:37:00Session 2 A
2086-8-201809:08:21Exercise 1
10956-8-201808:39:18Session 100
10956-8-201808:39:14Exercise 10
5066-8-201807:57:21Action 2
5066-8-201807:57:17Action 1
8446-8-201805:23:34Step 3
8446-8-201805:23:07Step 2
8445-8-201805:22:46Step 1
8445-8-201805:22:20Step 40

 

From this set I would like to filter on User_ID (unique) and Date-time (latest) and I would see for each filtered item the subject title.

 

So, when I create a visualizing table I would see:

 

user_iddatetimesubject_title
14166-8-201809:37:02Session 1 A
2086-8-201809:08:21Exercise 1
10956-8-201808:39:18Session 100
5066-8-201807:57:21Action 2
8446-8-201805:23:34Step 3

 

I have tried multiple things like LOOKUPVALUE and FIRSTNONBLANK, but I can't figure it out. 

 

I did manage to get only the latest date-time via: 
LastCompletionMoment = CALCULATE(MAX('Events Completion'[DateTime]);FILTER('Events Completion';'Events Completion'[user_id]=EARLIER('Events Completion'[user_id])))

 

Could someone help me out?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Atseaukes

 

Try the following steps:

 

1) Calculate Max Date for each User ID

= CALCULATE(MAX(date), ALLEXCEPT(TableName,TableName[user_id]))

 

2) Use If statement to find subject title

=IF(MAX DATE = DATE,subject_title,NULL)

View solution in original post

1 REPLY 1
Anonymous
Not applicable

@Atseaukes

 

Try the following steps:

 

1) Calculate Max Date for each User ID

= CALCULATE(MAX(date), ALLEXCEPT(TableName,TableName[user_id]))

 

2) Use If statement to find subject title

=IF(MAX DATE = DATE,subject_title,NULL)

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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