Forum Discussion

Mheadland's avatar
Mheadland
Frequent Visitor
2 years ago
Solved

Expressions that yield variant data-type cannot be used to define calculated columns ( with dates)

Hi all,   I am currently trying to create a column that states how long an item has been in stock, this is the formula I am using but I keep recieving the same error message:   I have tried t...
  • Ahmedx's avatar
    Ahmedx
    2 years ago

    or this

    DealerStockDays =
    IF (
        AND (
            '00_StockData'[R date] = DATE ( 2173, 10, 13 ),
            '00_StockData'[WSDate] = DATE ( 2173, 10, 13 )
        ),
        "-",
        IF (
            '00_StockData'[R date] = DATE ( 2173, 10, 13 ),
            ( TODAY () - '00_StockData'[WSDate] ) & "",
            (
                ( VALUE ( '00_StockData'[R date] ) - '00_StockData'[WSDate] ) & ""
            )
        )
    )