Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a basic order table with many different products. I would like to generate an overview for the last orderdate per customer per product. Cannot succeed in finding the right formula. Max formula only retrieves max of one value. Should I generate a new table for this or should I do that in the orderoverview table. Risking that for every orderline again, the max value needs to be calculated.
Please advise both on the best approach and the formula to use.
| CustomerID | ProductID | OrderDate |
| 1 | 1 | 1-1-2022 |
| 1 | 2 | 31-12-2021 |
| 1 | 3 | 25-7-2022 |
| 2 | 1 | 15-2-2022 |
| 2 | 1 | 12-7-2022 |
| 2 | 1 | 3-8-2022 |
| 3 | 1 | 3-8-2021 |
| 3 | 1 | 28-2-2022 |
| 3 | 2 | 5-7-2021 |
| 3 | 2 | 1-11-2021 |
| 3 | 2 | 1-4-2022 |
| 3 | 3 | 1-6-2021 |
| 4 | 1 | 1-7-2022 |
| 4 | 2 | 1-8-2022 |
| 4 | 3 | 1-9-2022 |
Solved! Go to Solution.
Hi,
Please check the below picture and the attached pbix file.
It is for creating a new table.
Last order date per customer and per product =
ADDCOLUMNS (
SUMMARIZE ( Data, Customer[CustomerID], 'Product'[ProductID] ),
"@maxdate", CALCULATE ( MAX ( Data[OrderDate] ) )
)
hi @JKVM
In addition to Jihwan's solution, if you have all the columns in one table, you may also write a table like this:
LastTable =
ADDCOLUMNS(
SUMMARIZE(
TableName,
TableName[CustomerID],
TableName[ProductID]
),
"LatestOrderDate",
CALCULATE(MAX(TableName[OrderDate]))
)
Or you can simply plot a table visual with [CustomerID] column, [ProductID] column and a measure like this:
LatestOrderDate2 = MAX(TableName[OrderDate])
hi @JKVM
In addition to Jihwan's solution, if you have all the columns in one table, you may also write a table like this:
LastTable =
ADDCOLUMNS(
SUMMARIZE(
TableName,
TableName[CustomerID],
TableName[ProductID]
),
"LatestOrderDate",
CALCULATE(MAX(TableName[OrderDate]))
)
Or you can simply plot a table visual with [CustomerID] column, [ProductID] column and a measure like this:
LatestOrderDate2 = MAX(TableName[OrderDate])
Hi,
Please check the below picture and the attached pbix file.
It is for creating a new table.
Last order date per customer and per product =
ADDCOLUMNS (
SUMMARIZE ( Data, Customer[CustomerID], 'Product'[ProductID] ),
"@maxdate", CALCULATE ( MAX ( Data[OrderDate] ) )
)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 32 | |
| 31 | |
| 18 | |
| 12 | |
| 11 |