Forum Discussion

RobertoArreola8's avatar
RobertoArreola8
Regular Visitor
3 years ago

Calculate a text value from a date column

Hi gurus!

 

I need your help as im trying to add a calculated column on a table. 

Basically I need everything greater than today's date to be classified as "new", I've tried to do something like this:

 

Status= IF('OSS Credit Notes'[InvoiceDate]>= TODAY()-1, "New", 'OSS Credit Notes'[InvoiceDate])

 

But I don't think is possible to assign text values from a date field... as i get the following warning:

 

"expressions that yield variant data-type cannot be used to define calculated columns"

 

Anyone with any solution? 😁

 

Thank you!

3 Replies

  • hi RobertoArreola8 

    just try like:

    Status= IF('OSS Credit Notes'[InvoiceDate]>TODAY(), "New", 'OSS Credit Notes'[InvoiceDate])

    • RobertoArreola8's avatar
      RobertoArreola8
      Regular Visitor

      Thank you! But it seems still is not working 😔

       

      I keep getting the same warning:

       

      • FreemanZ's avatar
        FreemanZ
        Icon for Super User rankSuper User

        AHA try like

        Status= IF([InvoiceDate]>TODAY(), "New", FORMAT([InvoiceDate], "YYYY/MM/DD"))

        RobertoArreola8