I am new to PowerPivot / DAX and am analyzing a table named BudgetTable with 5 columns. When the budgeted amount changes for an Item and Attribute combination, users add a new row to the table with a new record date. In the table below, for example, the 2/1/19, 3/1/19, 4/1/19 and 5/1/19 records are updates of prior Item and Attribute combinations.
ID Item Attribute Budget Amount Record Date
1 A AA $1000 1/1/19
2 A AA $2000 2/1/19
3 A BB $3000 1/1/19
4 A BB $4000 3/1/19
5 B AA $5000 1/1/19
6 B AA $6000 5/1/19
7 B BB $7000 1/1/19
8 B BB $8000 4/1/19
I would like to define a measure (Sum of Budget Amount) that sums up the Budget Amounts using the latest date for each Item and Attribute combination.
I have tried:
Sum of Budget Amount:=CALCULATE([BudgetTable], FILTER(BudgetTable, BudgetTable[Record Date]=Max(BudgetTable[Record Date])
but, that produces a pivot table that looks like:
Item Attribute Sum of Budget Amount
A $4000
AA $2000
BB $4000
B $6000
AA $6000
BB $8000
The expected pivot table would look like:
Item Attribute Sum of Budget Amount
A $6000
AA $2000
BB $4000
B $14000
AA $6000
BB $8000
Any help would be appreciated. Thank you!