Forum Discussion
MattAtBP
5 years agoFrequent Visitor
Formula help with Summarize, filter, max date...
Hi all, I'm trying to create a new table that shows the cost of the most recent purchase of 'Product 1', per customer. I've tried a formula using summarize with filter and max date but just not q...
- 5 years ago
New Table =
ADDCOLUMNS (
TREATAS (
GROUPBY (
FILTER ( Data, Data[product] = 1 ),
Customers[customer],
Products[product],
"@datemax", MAXX ( CURRENTGROUP (), Data[date] )
),
Data[customer],
Data[product],
Data[date]
),
"@cost", CALCULATE ( SUM ( Data[cost] ) )
)
Jihwan_Kim
5 years agoSuper User
New Table =
ADDCOLUMNS (
TREATAS (
GROUPBY (
FILTER ( Data, Data[product] = 1 ),
Customers[customer],
Products[product],
"@datemax", MAXX ( CURRENTGROUP (), Data[date] )
),
Data[customer],
Data[product],
Data[date]
),
"@cost", CALCULATE ( SUM ( Data[cost] ) )
)
MattAtBP
5 years agoFrequent Visitor
Many thanks, worked perfectly!