Reputation: 11
I have data in Azure Analysis Services (Tabular) that looks like the following table. I need to create two calculated columns for the Date that the Inventory Changed and the Amount of the Inventory Change. I think and IF function can take care of me for the date of the inventory changed. However, I'm stumped regarding how to calculate the amount of the inventory change.
What are some logical approaches to that?
Upvotes: 1
Views: 37
Reputation: 3741
Try use this:
[Amount of the Inventory Change] = 'YourTable'[Current Inventory Number] -
calculate( max('YourTable'[Current Inventory Number]), filter(values('YourTable'[InventorySnapshotDate]) , 'YourTable'[InventorySnapshotDate] < lastDate('YourTable'[InventorySnapshotDate]) ))
Upvotes: 1