Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!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.
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 | ||
Order | Tracking number | Delivery date |
123 | 10001 | 1/1/2020 |
124 | 10002 | 2/1/2020 |
125 | 10003 | 3/1/2020 |
126 | 10004 | 4/1/2020 |
125 | 10005 | 5/1/2020 |
123 | 10006 | 6/1/2020 |
Table 1:
Orders | |
Order | Last delivery date |
123 | 6/1/2020 |
124 | 2/1/2020 |
125 | 5/1/2020 |
126 | 4/1/2020 |
Thank you all!
See solution in post below.
https://community.powerbi.com/t5/Desktop/Get-the-last-delivery-date/td-p/1074681
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 )
Probably in Table1,
Last delivery date = MAXX(FILTER(RELATEDTABLE('Table2'),'Table2'[Order]=[Order]),[Delivery date])
Check out the May 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
72 | |
67 | |
65 | |
43 | |
42 |
User | Count |
---|---|
47 | |
38 | |
28 | |
28 | |
27 |