Forum Discussion
Values comparision number to text
Hi,
Can any one help for below error?
In excel I have a valid price column and in that column has $amount and “Contract not started” comments, but when I try to replicate below formula in power bi I am getting below error.
Start Date = IF([Valid Price]="CONTRACT NOT STARTED","N","Y")
Data Type for valid price in power bi =Decimal
DAX comparison operations do not support comparing values of type Number with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.
thanks
The data type of column [Valid Price] cannot be whole number or decimal if you have any rows with "Contract Not Yet Started". It would have to be text. I guess you don't have any rows that have that value?
10 Replies
- AlBCommunity Champion
It is not allowed to compare text and numbers.
Maybe use a number code for "CONTRACT NOT STARTED", like a negative number that I guess wont come up in prices?
- tejapowerbi123Helper V
I tried below,
Start Date = IF([Valid Price]=" ","N","Y")
but getting the same error.
- AlBCommunity Champion
Sure, you're still doing the same, comparing a number to text.
You could use the query editor to easily replace all occurrences of your text string with a number