imani_technology
imani_technology

Reputation: 11

Calculate Amount of Inventory Change in Azure Analysis Services DAX

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?

Inventory Info in Analysis Services

Upvotes: 1

Views: 37

Answers (1)

msta42a
msta42a

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

Related Questions