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
HI Anonymous ,
Create a Calculated Column
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 = 0, "A,D,I",
a = 0
&& b = 1 & c = 0, "D"
)
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
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
- Anonymous6 years agoNot applicable
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