# Minimum Date Calculation

Hello,

I’m trying to return the inventory from the minimum day on this table visual.

Ultimately, I would like to calculate the rolling change in inventory from the minimum filtered date. So, the final cumulative total would be - 182,409.

I can’t understand why this formula isn’t working to give me the minimum…

Min Inventory =
CALCULATE(
SUM( Inventory[Inventory Quantity] ),
FILTER( ALLSELECTED( ‘Date’ ), ‘Date’[Date] = MIN( ‘Date’[Date] ) )
)

Thank you in advance for all of your help!

@wesleyfletcher try this:

``````    Min Inventory =
VAR myFirstDate =
CALCULATE( MIN( Date[Date] ),
ALLSELECTED( ‘Date’)
)
RETURN

CALCULATE(
SUM( Inventory[Inventory Quantity] ),
‘Date’[Date] = myFirstDate
)``````

Thank you for your answer, but this isn’t working because the syntax is incorrect. I will continue to test your suggestions to see if I can arrive at a solution.

A screenshot of this visual is not real helpful…Can you provide an example and perhaps a model diagram?

@wesleyfletcher this will return the result of [Average Inventory] on the first ‘visible’ date

``````Min Inventory =
VAR myFirstDate =
CALCULATE( MIN( Date[Date] ),
ALLSELECTED( Date )
)
RETURN

CALCULATE(
[Average Inventory],
Date[Date] = myFirstDate
)
``````

I hope this is the solution that you’re after. If not, please supply more details.

Hi @wesleyfletcher, we’ve noticed that no response has been received from you since Nov 22, 2019. We just want to check if you still need further help on this post? In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved. You may reopen a new thread when the need arise.