Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Cannot convert string value of type text to True/False

I can't figure out why I am getting this error...

"Cannot convert value 'Group B' of type Text to type True/False" in the example below:

 

Type =
if('Incident Data'[Support Group] = "Apple"
||'Incident Data'[Support Group] = "Orange"
&& not(CONTAINSSTRING('Incident Data'[Template],"Banana"||"Grapes")), "Group A"
,IF('Incident Data'[Support Group] = "Cucumber"
||'Incident Data'[Support Group] = "Tomatoe"
||'Incident Data'[Support Group] = "Broccoli"
&& (CONTAINSSTRING('Incident Data'[Template], "Banana"||"Grapes")),"Group B"))
 
Any ideas?
 
3 REPLIES 3
bsheffer
Continued Contributor
Continued Contributor

check the type of your measure or calculated field.  It needs to be text

Anonymous
Not applicable

Yes, it is Text

 

gabbyl03_0-1677796058428.png

 

bsheffer
Continued Contributor
Continued Contributor

I don't see anything wrong with the type then.  However whenever you use both "ands" and "ors" you need to use parentheses to group the ors together.

 

'Incident Data'[Support Group] = "Cucumber"
||'Incident Data'[Support Group] = "Tomatoe"
||'Incident Data'[Support Group] = "Broccoli"
&& (CONTAINSSTRING('Incident Data'[Template]"Banana"||"Grapes"))
 
should be
(
'Incident Data'[Support Group] = "Cucumber"
||'Incident Data'[Support Group] = "Tomatoe"
||'Incident Data'[Support Group] = "Broccoli"
)
&& (CONTAINSSTRING('Incident Data'[Template]"Banana"||"Grapes"))

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.