Forum Discussion
DAX
- Anonymous2 years ago
Hi KT9 ,
Looks like you're trying to create a measure instead of a calculated column. If you use the same exact code, but as a calculated column, you shouldn't have an issue.
Or you can modify KT9 's formula.
Result = SWITCH(TRUE(), YourTable[Final] = "Negative", "Negative", YourTable[Final] = "Positive" && YourTable[Type] = "ABCD", max(YourTable[Numeric_Result]), YourTable[Final] = "Positive" && YourTable[Type] = "XYZ", "Positive", YourTable[Final] = "In Range", "In Range", BLANK() )How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ RongtieIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Try this
Result =
SWITCH(TRUE(),
YourTable[Final] = "Negative", "Negative",
YourTable[Final] = "Positive" && YourTable[Type] = "ABCD", YourTable[Numeric_Result],
YourTable[Final] = "Positive" && YourTable[Type] = "XYZ", "Positive",
YourTable[Final] = "In Range", "In Range",
BLANK()
)
Hi ElliotG ,
Thank you so much for your response. while importing the SQL data into power BI, I used import query option and wrote the sql query to filter the data and then i load it into the power BI. I tried to write the DAX formulae but it is thowing me this error. I have no idea.
- Anonymous2 years agoNot applicable
Hi KT9 ,
Looks like you're trying to create a measure instead of a calculated column. If you use the same exact code, but as a calculated column, you shouldn't have an issue.
Or you can modify KT9 's formula.
Result = SWITCH(TRUE(), YourTable[Final] = "Negative", "Negative", YourTable[Final] = "Positive" && YourTable[Type] = "ABCD", max(YourTable[Numeric_Result]), YourTable[Final] = "Positive" && YourTable[Type] = "XYZ", "Positive", YourTable[Final] = "In Range", "In Range", BLANK() )How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ RongtieIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.