Forum Discussion
Conditonal Column based on Calculated Columns
- Anonymous6 years ago
Hi Anonymous ,
i missed an &
Try this
Calculated Column = VAR a = 'Table'[archivingvehicles] VAR b = 'Table'[deleting vehicles] VAR c = 'Table'[invoicingvehicles] RETURN SWITCH ( TRUE (), a = 1 && b = 0 && c = 0, "A", a = 1 && b = 1 && c = 0, "A,D", a = 1 && b = 1 && c = 1, "A,D,I", a = 0 && b = 1 && c = 0, "D" )Regards,
Harsh Nathani
Anonymous Thank you.
I have tried it and I get this error. Are you able to help, I have not used this function before.
"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."
The three columns were a Data Type of 'Number', I tried changing them to Text but that hasn't resolved it.
Thank you for your help
Hi Anonymous ,
i missed an &
Try this
Calculated Column =
VAR a = 'Table'[archivingvehicles]
VAR b = 'Table'[deleting vehicles]
VAR c = 'Table'[invoicingvehicles]
RETURN
SWITCH (
TRUE (),
a = 1
&& b = 0
&& c = 0, "A",
a = 1
&& b = 1
&& c = 0, "A,D",
a = 1
&& b = 1
&& c = 1, "A,D,I",
a = 0
&& b = 1
&& c = 0, "D"
)
Regards,
Harsh Nathani
- Anonymous6 years agoNot applicable
Hi Anonymous
Afraid I am still getting the same error
- Anonymous6 years agoNot applicable
Hi Anonymous ,
Not sure why. I tried it. It is working. make sure both places you have a && &&
Regards,
HN
- Anonymous6 years agoNot applicable
HI Anonymous
I'm not sure why either. What I have done is changed the 1,0 to YES and NO as a Text type and it has worked.
Thank you for all your help!