Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have to add one custom column called "different" by using switch case as below :
CASE
WHEN (diff <= 5) and (diff >= -5) THEN 'direct offset'
WHEN diff < -5 THEN 'overpay offset'
END
I tried below switch case but it is showing error as "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".
Switch case :
different = SWITCH( TRUE(),
AND([diff] <= -5 , [diff] >= -5 ), "directoffset",
[diff] < -5 ,"overpayoffset"
)
Can someone please help me with this.
Thank you.
Solved! Go to Solution.
Hi @Rup10 - the most likely culprit is that [diff] is formatted as text. Change it to some number format either in Transform Data or in the model itself and it ought to work.
(Side note, and this is probably just an error in typing the post, but your first option on switch has "-5" on both inequalities)
Hope this helps
David
Please consider this solution and leave kudos
Look at the message "DAX comparison operations do not support comparing values of type Text with values of type Integer."
This suggests that [diff] is text.
If [diff] is a column in your query then change the data type from text to numeric>
If [diff] is a measure then you can covert it to a number
Hi @Rup10 - the most likely culprit is that [diff] is formatted as text. Change it to some number format either in Transform Data or in the model itself and it ought to work.
(Side note, and this is probably just an error in typing the post, but your first option on switch has "-5" on both inequalities)
Hope this helps
David
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |