Reputation: 89
I am getting this error when I try to create a measure in Power BI:
Function SWITCH does not support comparing values of type True/False with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.
I am unable to fix this from my end
Here is the DAX measure I am creating:
SWITCH (
SELECTEDVALUE ( 'vw_OA_dashboard_SSL_Region'[SSL_Abbr] ),
AND ("Audit", [Company_Filtered] = 1 ), SUM ( vw_OA_dashboard_SSL_Region[open_opportunities] ),
AND ("BTS", [Company_Filtered] = 1 ), SUM ( vw_OA_dashboard_SSL_Region[open_opportunities] ),
AND ("C&G", [Company_Filtered] = 1 ), SUM ( vw_OA_dashboard_SSL_Region[open_opportunities] ),
AND ("CYBER", [Company_Filtered] = 1 ), SUM ( vw_OA_dashboard_SSL_Region[open_opportunities] ),
AND ("EY-P", [Company_Filtered] = 1 ), SUM ( vw_OA_dashboard_SSL_Region[open_opportunities] ),
" "
)```
Upvotes: 0
Views: 3083
Reputation: 206
Try this:
IF ([Company_Filtered] = 1, SWITCH ( SELECTEDVALUE ( 'vw_OA_dashboard_SSL_Region'[SSL_Abbr] ), "Audit", SUM ( vw_OA_dashboard_SSL_Region[open_opportunities] ), "BTS", SUM ( vw_OA_dashboard_SSL_Region[open_opportunities] ), "C&G", SUM ( vw_OA_dashboard_SSL_Region[open_opportunities] ), "CYBER", SUM ( vw_OA_dashboard_SSL_Region[open_opportunities] ), "EY-P", SUM ( vw_OA_dashboard_SSL_Region[open_opportunities] ), "" ), "")
Upvotes: 1