Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi there,
I'm pretty new to Dax, and am trying to get an If statement to work - I have 3 outcomes, and the data in the original field is numbers and blanks.
This is how far I've gotten but I'm seeing errors with Text vs integer data types.. Can anyone tell me what I need to do to get this to work?
Solved! Go to Solution.
Try
Open Vs Effective Date Buckets =
IF (
ISBLANK ( 'All ServiceNow Data'[Open Vs Effective Date] ),
"Invalid Effective Date",
IF (
'All ServiceNow Data'[Open Vs Effective Date] < 0,
"Opened Before Effective Date",
"Opened on/after Effective Date"
)
)
Thank you for your prompt relpy! johnt75
Hi @MeganLouise93
I'm trying to reproduce your error, when the 'Open Vs Effective Date' column type is Text, the error will occur.
You can use the following two methods to solve this problem.
First: Change the type from text to number
Second: Use Value function
Open Vs Effective Date Buckets =
IF (
ISBLANK ( VALUE('All ServiceNow Data'[Open Vs Effective Date] )),
"Invalid Effective Date",
IF (
VALUE('All ServiceNow Data'[Open Vs Effective Date] ) < 0,
"Opened Before Effective Date",
"Opened on/after Effective Date"
)
)
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for your response - Johnt75's solution worked perfectly as I had already amended the fields to numbers 😄
Try
Open Vs Effective Date Buckets =
IF (
ISBLANK ( 'All ServiceNow Data'[Open Vs Effective Date] ),
"Invalid Effective Date",
IF (
'All ServiceNow Data'[Open Vs Effective Date] < 0,
"Opened Before Effective Date",
"Opened on/after Effective Date"
)
)
Thank you - Unfortunately this is still returning the error "DAX comparison operations do not support comparing values of type Text with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values." 😔
Check the type of 'All ServiceNow Data'[Open Vs Effective Date] and make sure it is one of the numeric types, it sounds like it is text at the moment.
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
19 | |
14 | |
10 | |
7 |