Forum Discussion
cchp07
6 years agoFrequent Visitor
Power BI DAX Function 'SWITCH' does not support comparing values of type True/False
I am getting this error when I try to create a column in Power BI: Function 'SWITCH' does not support comparing values of type True/False with values of type Text. Consider using the VALUE or FORM...
- 6 years ago
is this a colunm or a measure
if measure then you must use a max of the colunm values that you are comparing
Status = SWITCH ( TRUE(), MAX([G1TDTE]) = "Null", "Plan", AND ( max([G1DDTE]) = "Null", max([G1CDTE]) = "Null" ), "Undone Wip", max([G1CDTE]) = "Null", "Done Wip", "Finished" )for colunm no max need use the col ref as is
Status_COL = SWITCH ( TRUE(), [G1TDTE] = "Null", "Plan", AND ([G1DDTE] = "Null", [G1CDTE] = "Null" ), "Undone Wip", [G1CDTE] = "Null", "Done Wip", "Finished" )this only works if you have replaced you colunm with text colunms
AnthonyTilley
6 years agoSolution Sage
is this a colunm or a measure
if measure then you must use a max of the colunm values that you are comparing
Status =
SWITCH (
TRUE(),
MAX([G1TDTE]) = "Null", "Plan",
AND ( max([G1DDTE]) = "Null", max([G1CDTE]) = "Null" ), "Undone Wip",
max([G1CDTE]) = "Null", "Done Wip",
"Finished"
)for colunm no max need use the col ref as is
Status_COL =
SWITCH (
TRUE(),
[G1TDTE] = "Null", "Plan",
AND ([G1DDTE] = "Null", [G1CDTE] = "Null" ), "Undone Wip",
[G1CDTE] = "Null", "Done Wip",
"Finished"
)this only works if you have replaced you colunm with text colunms