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

LOOKUP VALUE or FIRSTNONBLANK to retrieve FIRST than SECOND than THIRD ... RESULTS

Hi

I have a very long source table that i'm using for another one, i will resume my problem in below

Trucks       Entered                 

A             01.01.2021       

B             06.03.2021       

C             12.04.2021

A             15.01.2021    

A             28.01.2021

C             14.04.2021

... etc

I would like in the other table to search for the first time, second time, third time ... every truck entred

I tried to use LOOKUPVALUE and FIRSTNONBLANK but is always giving me the first result

I want it in a column not in a measure

 

Thanks

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @MoumouhElRebeld 

 

You can try the following methods.

Table2:

Table 2 = VALUES('Table'[Trucks])

Column:

FIRST = 
CALCULATE(MIN('Table'[Entered]),FILTER(ALL('Table'),[Trucks]=EARLIER('Table 2'[Trucks])))
SECOND = 
CALCULATE(MIN('Table'[Entered]),FILTER(ALL('Table'),[Trucks]=EARLIER('Table 2'[Trucks])&&[Entered]<>[FIRST]))
THIRD = 
CALCULATE(MIN('Table'[Entered]),FILTER(ALL('Table'),[Trucks]=EARLIER('Table 2'[Trucks])&&[Entered]<>[FIRST]&&[Entered]<>[SECOND]))

vzhangti_0-1647408966017.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @MoumouhElRebeld 

 

You can try the following methods.

Table2:

Table 2 = VALUES('Table'[Trucks])

Column:

FIRST = 
CALCULATE(MIN('Table'[Entered]),FILTER(ALL('Table'),[Trucks]=EARLIER('Table 2'[Trucks])))
SECOND = 
CALCULATE(MIN('Table'[Entered]),FILTER(ALL('Table'),[Trucks]=EARLIER('Table 2'[Trucks])&&[Entered]<>[FIRST]))
THIRD = 
CALCULATE(MIN('Table'[Entered]),FILTER(ALL('Table'),[Trucks]=EARLIER('Table 2'[Trucks])&&[Entered]<>[FIRST]&&[Entered]<>[SECOND]))

vzhangti_0-1647408966017.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1647197404421.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Thanks

What is LOGS[Return] pls ?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.