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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
Grevatious
Frequent Visitor

Get the last delivery date

Hello everyone

I need help! I have two tables. The first one has all the description of the order and the customer information and the other shows all the information related to the delivery of each order. Each order may have 2 or more tracking numbers with different delivery dates.

What I'm trying to do is get the last delivery date from table 2 for each order in table 1.

I've tried many times in vain, so on the right I'm using the formula "Firstnoblank", but this only returns the first value it finds instead of the last one by date.

Table 2:

Delivery information
OrderTracking numberDelivery date
123100011/1/2020
124100022/1/2020
125100033/1/2020
126100044/1/2020
125100055/1/2020
123100066/1/2020

Table 1:

Orders
OrderLast delivery date
1236/1/2020
1242/1/2020
1255/1/2020
1264/1/2020

Thank you all!

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@Grevatious 

 

See solution in post below.

https://community.powerbi.com/t5/Desktop/Get-the-last-delivery-date/td-p/1074681

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

Use this measure in you table to display the date

 

 

Measure =
VAR __id = MAX( 'Table'[Orders] )
VAR __date = CALCULATE ( MAX( 'Table'[Delivery date] ), ALLSELECTED ( 'Table' ), 'Table'[Orders] = __id )
RETURN CALCULATE ( MAx ( 'Table'[Delivery date] ), VALUES ( 'Table'[Orders] ), 'Table'[Orders] = __id, 'Table'[Delivery date] = __date )

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Greg_Deckler
Super User
Super User

Probably in Table1,

 

Last delivery date = MAXX(FILTER(RELATEDTABLE('Table2'),'Table2'[Order]=[Order]),[Delivery date])

 

 



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

Check out the May 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

May 2025 Monthly Update

Fabric Community Update - May 2025

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