Forum Discussion
Velocity
6 years agoHelper III
Help with ISNUMBER function in DAX
Hi, I am trying to extract month and year form two text fields. It is either embedded in field1 or field2. I have to try field one first and if it can't be extracted from field1, then it should be e...
- 6 years ago
Right, so ISNUMBER isn't working because it is testing if it is a number. It is not, it is text. You probably want:
Column = IF( ISERROR(VALUE(LEFT([Field1],4))), LEFT([Field2],4), LEFT([Field1],4) )See attached.
Greg_Deckler
6 years agoCommunity Champion
Hmm, I'm guessing it is the 0 padding that is throwing things off.
- Velocity6 years agoHelper III
I don't think 0 padding is the issue.
left(Sales[Field1],4) should return '0718' and why is that not being treated as number is the issue. Unfortunately, i have to use data as received.
- Greg_Deckler6 years agoCommunity Champion
Right, so ISNUMBER isn't working because it is testing if it is a number. It is not, it is text. You probably want:
Column = IF( ISERROR(VALUE(LEFT([Field1],4))), LEFT([Field2],4), LEFT([Field1],4) )See attached.
- Velocity6 years agoHelper III
Thanks a ton Greg