Forum Discussion
Value before the firstnonblankvalue
Hi, i am trying to compute for the value before the firstnonblankvalue. I am computing for Beginning Inventory of a particular model, my date looks like this:
Date Particulars Item Qty
9/30/2020 InvEnd Item 1 100
10/1/2020 InvEnd Item 1 90
10/31/2020 InvEnd Item 1 50
My filters based on Calendar date.
Since the ending inventory of a particular day will be the beginning inventory of the next day i didnt include a separate beginning inventory column. My current DAX on the beginning inventory looks like this ( for October Beginning Inventory)
Inv = FIRSTNONBLANKVALUE( 'Calendar'[Date] ,
2 Replies
- amitchandak
Super User
jmcph , Try a new column like
new column =
calculate(lastnonblankvalue([Date], sum(Table[Qty])), filter(Table, [item] =earlier([item]) && [Date] <earlier([Date]))) - AnonymousNot applicable
Hi jmcph ,
Sorry, not very clear.
Do you want to put the first non-blank value (100) in the Inventory table into the row of the day before the corresponding date in the calendar table?
FIRSTNONBLANKVALUE has already filtered out non-blank values, so if the value on September 30 is blank, it will continue to find the first non-blank value.Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.