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
henriquerzatk
Regular Visitor

How can I: Returns the most recent value, filtering two dates.

Hi everyone.

 

I have the following situation:

 

I have two tables, and I need to create a column in table 2 (ID_2), which brings me ID_2 of type "Mtk", that its date_ID2 is the most recent, but less than the date_ID_3, from table 1; 

 

henriquerzatk_1-1669990170355.png

 

Thanks all. 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@henriquerzatk , New column in table2

 

Maxx(filter(Table1, Table1[ID_1] = Table2[ID_1] && Table1[Date_ID2] <= Table2[Date_ID3]), Table1[ID_2])

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@henriquerzatk , New column in table2

 

Maxx(filter(Table1, Table1[ID_1] = Table2[ID_1] && Table1[Date_ID2] <= Table2[Date_ID3]), Table1[ID_2])

Wow, thank you so much, this helped me a lot. 🙌

Now a second doubt, continuing in the same situation.

Is it possible, I determine a number of days, as a limit for it to pull or not the value of ID_2?

Example:

Only bring ID_2 if: Date_ID3 - Date_ID2 <= 120

Thanks.

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.

Top Solution Authors