Forum Discussion
anonymous_98
4 years agoResolver I
DAX comparison operations do not support comparing values of type Date with values of type Text
Error Message: DAX comparison operations do not support comparing values of type Date with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values. can you p...
- 4 years ago
I have found the solution for this.
here is the piece of code in the DAX code which caused issue.
before fixing:
CALCULATETABLE( VALUES(Sales[Customer ID]), FILTER( ALL(Sales), Sales[Purchase Date] >= _DateBeforeNDays & Sales[Purchase Date] <= _EndOfMonthDate ) )After fixing:
CALCULATETABLE( VALUES(Sales[Customer ID]), FILTER( ALL(Sales), Sales[Purchase Date] >= _DateBeforeNDays && Sales[Purchase Date] <= _EndOfMonthDate ) )why the error caused in the first place?
--> if you see in the first code, instead of using && operator I was just using & operator. and that was the only reason for the error.
Syndicate_Admin
3 years agoAdministrator
Hello good day
This dax throws me the error "DAX comparison operations do not support interger comparison values with Text values.Consider using the VALUE or FORMAT function to convert one of the values.
Could you help me please?
Thank you
VALOR DPP =
IF(AND([TOTAL CUSTOMERS]="A",[TOTAL DAYS]<=30),0.05*[TOTAL INVOICES],
IF(AND([TOTAL CUSTOMERS]="B", [TOTAL DAYS]<=60),0.01*[TOTAL INVOICES],
IF(AND([TOTAL CUSTOMERS]="C", [TOTAL DAYS]<=60),0.05*[TOTAL INVOICES],
"No discount"
)))
anonymous_98
3 years agoResolver I
Syndicate_Admin in case TOTAL CUSTOMERS is a number then if you are comparing it with a String "A" which is wrong. also check the data type of TOTAL DAYS, it should be integer.