Forum Discussion
simple measure
hi all,
i need a simple measure DAX expression that checks a bit field and gets a value of "GOOD" when the field tested is 1 AND "BAD" if the tested fields is 0.
All my common sense attempts failed as I can't get the syntax ... and neither a fast answer to a simple question.
Thanks
Hello vrv ,
If you need to have the result in the below format, you need to create a Calculated column. You are not able to enter the column name because you are trying to create a measure. And a column cannot be used in a measure.Result = SWITCH(Table_Name[column_name], 1, "GOOD", 0, "BAD")
OR
Result = IF(Table_Name[column_name] = 1, "GOOD", "BAD")
5 Replies
- saurabhkudale96Frequent Visitor
Hello vrv
Please review the below:
Result = SWITCH(TestedField, 1, "GOOD", 0, "BAD")
OR
Result = IF(TestedField = 1, "GOOD", "BAD")
Note: Replace "TestedField" with the name of the bit field in your data model.
Also, please upvote if you find it helpful.- vrv
Helper II
hello saurabhkudale96,
what is the proper syntax for "TestedField"?
is it: Table.FieldName, [Table]FieldName, [Table]"FieldName", [Table].[FieldName] ........ ???
Thanks,
vrv
- saurabhkudale96Frequent Visitor
It is the "Bit Field". Please enter your Column name there.
- vrv
Helper II
Hi anybody, any idea?
my question is how do I enter the column name?
what is the correct format?
Apparently I can't drag and drop the column in there, so somethign is wrong ...
Thank you,
vrv
I
- saurabhkudale96Frequent Visitor
Hello vrv ,
If you need to have the result in the below format, you need to create a Calculated column. You are not able to enter the column name because you are trying to create a measure. And a column cannot be used in a measure.Result = SWITCH(Table_Name[column_name], 1, "GOOD", 0, "BAD")
OR
Result = IF(Table_Name[column_name] = 1, "GOOD", "BAD")