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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
MrAnalytic
New Member

Find a LAST ORDER DATE

Hi everyboy,

I have a problem. Now it is a big problem. I went through all threads about DAX & PowerBI and I cannot find a correct solution.
What is the point?

I have a dataset to analyze. It includes:
- "Article" table where different articles (items) are stored
- "Warehouse Documents" table where each order has its own counterpart; each order can have more than one article on it of course
- "Position of Warehouse Documents" table that has connection to "Warehouse Documents" and "Article" so I can find for instance on which orders one single article has been sold and etc

So, I have already made a different measures, calculations and so on and it works quite fine.
But, I am stucked with one info: I would like to add to my dashboard - the DATE of the LAST ORDER for ARTICLE

 

Let's get the example:

"ARTICLE" table:

Product_NameTradeIndexUniquePriceCategoryID_Article
Item_11234567112,45€A11
Item_21234567223,56€A22
Item_31234567310,00€B13
Item_41234567421,50€B14
Item_5123456758,56€B15
Item_612345676100,00€A26

 

"WAREHOUSE DOCUMENTS" table:

 DateID_WAREHOUSE_DOCUMENTS
Order_1    12.04.2010     1
Order_2    18.07.2011     2
Order_3    21.03.2015     3
Order_4    22.05.2019     4
Order_5    18.03.2020     5

 

"Position Warehouse Documents" table:

 

ID_Position_Warehouse_DocumentsID_Warehouse_DocumentsDateID_ArticleQuantityPrice
1112.04.2010210100€
2112.04.2010120199€
3218.07.2011214140€
4218.07.2011310150€
5218.07.201111200€
6321.03.20152250€
7321.03.201541020€
8321.03.20153510€

 

 

As you see ARTICLE "Item_2" has been sold three times and I would like to get the DATE of the LAST ORDER so in this case would be : 21.03.2015
For Item_1 it would be 18.07.2011 and for Item_3 = 21.03.2015

 

Can you tell me how I can calculate it?

I have already tried different functions: CALCULATE, CALCULATETABLE, ADDCOLUMNS and many others but to be honest I don't know which one I should use. Honestly I am lost here ... I hope the example is clear.
If not please let me know. Thanks in advance for any suggestions - it shoulnd't be so tricky 😞

 

BR,
MrAnalytic

1 REPLY 1
Anonymous
Not applicable

Hey,

 

You can just use the measure

Measure 3 = MAX('Position Warehouse Documents'[Date])

See screenshot:

 

EricHulshof_0-1599638185120.png

Eric.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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