Forum Discussion

waleed111's avatar
waleed111
Helper V
5 years ago
Solved

text to date converting

when i write this formula: sales year = FORMAT('Purchase Order Received Report'[Added Time], "yyyy") then use it as date type it show me this error: Cannot convert value '2020' of type Text to ty...
  • Anonymous's avatar
    Anonymous
    5 years ago

    HI waleed111,

    So you mean you want to change the date type field to only display the year values? If this is a case, I'd like to suggest you take a look at the following link about table properties text formatting which only changes the disabled format and keeping raw field values.

    Use custom format strings in Power BI Desktop 

    Notice: format function will return text values with the custom format as you defined in the optional parameter.
    Regards,

    Xiaoxin Sheng