Forum Discussion
LC01
1 year agoFrequent Visitor
Aggrate Sales with Date
Hi, It's something I've not done in sometime so I'm not sure the correct way to do it, here is my current issue : I'm trying to get the Budget on a date that correspond to the last time the item...
parry2k
Super User
1 year agoLC01 isn't it a simple sum of the budget column, what measure are you using?
LC01
1 year agoFrequent Visitor
No it wont work,
My budget table date goes past my actual sales date, I need to get back the budget on the latest actual sales date.
Currently I have :
TEST_budget_last_date = CALCULATE(max(data[Budget]),FILTER(data,LTP_data[Actual Date] = max(Sales'[SalesDate])))
Working well in a table, but not in a card.
- Anonymous1 year agoNot applicable
Hi LC01 ,
The issue could be related to context transition when using the CALCULATE() function,try below:
TEST_budget_last_date = VAR LatestSalesDate = MAX(Sales[SalesDate]) RETURN CALCULATE( MAX(data[Budget]), FILTER( data, data[Actual Date] = LatestSalesDate ) )Hope it helps!
Best regards,
Community Support Team_ Scott ChangIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.