Forum Discussion

Farnaz_Raj98's avatar
Farnaz_Raj98
Frequent Visitor
4 years ago
Solved

use value function to convert text column into number

Hi every one,
I have a column with date/time data type which named "LastCreateDateOrder" and I want to make a measure to find out how many users didn't visit site during 3 last months. so I used below formula:

CALCULATE(COUNT(users[userid]), VALUE(FORMAT(users[LastCreateDateOrder].[Date],"YYYYMMDD"))<=VALUE(FORMAT(DATEVALUE(TODAY()-90),"YYYYMMDD")))
I faced with an error which is "Cannot convert value '' of type Text to type Number." and it's because of this part of formula "VALUE(FORMAT(users[LastCreateDateOrder].[Date],"YYYYMMDD"))".
I don't understand why VALUE function can't convert the date with test format into number!
I tried this formula with CONVERT function too but I havn't got the answer ๐Ÿ˜ž
Can anybody help me please?
  • Hi!

    I think that you need to use formula without VALUE and FORMAT

2 Replies

  • Hi!

    I think that you need to use formula without VALUE and FORMAT

    • Farnaz_Raj98's avatar
      Farnaz_Raj98
      Frequent Visitor

      Yeah it works ๐Ÿ™„I don't know why I didn't try itโ˜น๏ธ