Forum Discussion
Anonymous
4 years agoNot applicable
Adding missing date rows and filling in Quantity
Hi, I have a table INVENTORY which has Inv_Date and the respective Quantity, as follows; Inv_Date Quantity 01.01.2021 10 02.01.2021 10 05.01.2021 15 07.01.2021 ...
AlexisOlson
Super User
4 years agoI think this is because CALENDAR generates a table with a column named [Date], not [Inv_Date].
Try using [Date] instead of [Inv_Date] inside of EARLIER or else use variables like this:
FullDateTable =
ADDCOLUMNS (
CALENDAR (
MIN ( INVENTORY[Inv_Date] ),
MAX ( INVENTORY[Inv_Date] )
),
"Quantity",
VAR CurrDate = [Date]
VAR LastInv_Date =
MAXX (
FILTER (
INVENTORY,
INVENTORY[Inv_Date] <= CurrDate
),
[Inv_Date]
)
RETURN
LOOKUPVALUE (
INVENTORY[Quantity],
INVENTORY[Inv_Date], LastInv_Date
)
)Anonymous
4 years agoNot applicable
Thanks for your suggestions.
I tried using [Date] with the EARLIER function and it gave me the error: "A table of multiple values was supplied where a single value was expected."
Also with the variables in your second suggestion, I got the same error: "A table of multiple values was supplied where a single value was expected."