Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
power bi function SWITCH does not suppport comparing values of type true/false. Consider using the VALUE or FORMAT
The orginial condition was
power bi function SWITCH does not suppport comparing values of type true/false. Consider using the VALUE or FORMAT
StatusColourNum = SWITCH('ActiveCIP'[Status]=BLANK(),8, "Completed",1, "In progress & on schedule",2,"Yet to commence",3,"Behind schedule",4,"No status",5,"Not Progressing",6, "Archive",7)
How can this statement work?
TIA
Solved! Go to Solution.
Hi @dd88
Try this
StatusColourNum =
SWITCH(
TRUE(),
ISBLANK('ActiveCIP'[Status]),8,
'ActiveCIP'[Status] = "Completed", 1,
'ActiveCIP'[Status] = "In progress & on schedule", 2,
'ActiveCIP'[Status] = "Yet to commence", 3,
'ActiveCIP'[Status] = "Behind schedule", 4,
'ActiveCIP'[Status] = "No status", 5,
'ActiveCIP'[Status] = "Not Progressing", 6,
'ActiveCIP'[Status] = "Archive", 7
)
Alternatively, if all possible conditions (string values) of 'ActiveCIP'[Status] are listed in that code (values 1 through 7) then you can make the default result of the SWITCH be the result you want for BLANK values
StatusColourNum =
SWITCH(
TRUE(),
'ActiveCIP'[Status] = "Completed", 1,
'ActiveCIP'[Status] = "In progress & on schedule", 2,
'ActiveCIP'[Status] = "Yet to commence", 3,
'ActiveCIP'[Status] = "Behind schedule", 4,
'ActiveCIP'[Status] = "No status", 5,
'ActiveCIP'[Status] = "Not Progressing", 6,
'ActiveCIP'[Status] = "Archive",7,
8
)
Regards
Phil
Proud to be a Super User!
Hi @dd88
Try this
StatusColourNum =
SWITCH(
TRUE(),
ISBLANK('ActiveCIP'[Status]),8,
'ActiveCIP'[Status] = "Completed", 1,
'ActiveCIP'[Status] = "In progress & on schedule", 2,
'ActiveCIP'[Status] = "Yet to commence", 3,
'ActiveCIP'[Status] = "Behind schedule", 4,
'ActiveCIP'[Status] = "No status", 5,
'ActiveCIP'[Status] = "Not Progressing", 6,
'ActiveCIP'[Status] = "Archive", 7
)
Alternatively, if all possible conditions (string values) of 'ActiveCIP'[Status] are listed in that code (values 1 through 7) then you can make the default result of the SWITCH be the result you want for BLANK values
StatusColourNum =
SWITCH(
TRUE(),
'ActiveCIP'[Status] = "Completed", 1,
'ActiveCIP'[Status] = "In progress & on schedule", 2,
'ActiveCIP'[Status] = "Yet to commence", 3,
'ActiveCIP'[Status] = "Behind schedule", 4,
'ActiveCIP'[Status] = "No status", 5,
'ActiveCIP'[Status] = "Not Progressing", 6,
'ActiveCIP'[Status] = "Archive",7,
8
)
Regards
Phil
Proud to be a Super User!
User | Count |
---|---|
77 | |
77 | |
68 | |
67 | |
49 |
User | Count |
---|---|
108 | |
105 | |
93 | |
83 | |
64 |