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

create a column looking for a value in the same table

table1    result 
       
id referencedate  reference-date
110005/08/2018  06/08/2018 
100 06/08/2018   06/08/2018 
200130/06/2018  05/08/2018 
       

 

I got  a table1, in the row "id" 1 I need to see the reference number "100" search between "id" if match copy the date of this "ID" 100  ( in this case 06/08/2018)

the result has to be like an extra column in the table with the related date if found

if no reference number (not match or empty), just copy the date of the id without reference or not matching

and so on for all row

I hope to be clear

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

Column = 
MAXX(FILTER(ALL(Table1),[id]=EARLIER([reference])),[date]) 

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

Column = 
MAXX(FILTER(ALL(Table1),[id]=EARLIER([reference])),[date]) 

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

in the case,  "reference" is not matching "id ", it copy the id date as for line starting with id 100

referencedate  reference-date
110005/08/2018  06/08/2018 
100 06/08/2018   06/08/2018( this one) 
200130/06/2018  05/08/2018

@snifer Please try this...

 

ReferenceDate = 
VAR _lkpRef = LOOKUPVALUE(LkpIDRef[Date],LkpIDRef[ID],LkpIDRef[Reference])
RETURN FORMAT(IF(ISBLANK(_lkpRef),LkpIDRef[Date],_lkpRef),"dd MMMM yyyy") 

image.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




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.