<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: DAX Switch statement error in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-statement-error/m-p/1388261#M25391</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="178884" data-lia-user-login="im_newbie_123" class="lia-mention lia-mention-user"&gt;im_newbie_123&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;It seems your column [ID] returns a nontext value and you are comparing with text. You can convert to the text value and do the SWTICHCH like&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Column1 = 
VAR X = FORMAT([ID],"@") RETURN
SWITCH(True(),
 X = "FH20-10","YES",
 X = "FA30-10","YES",
 X = "FA60-20","YES",
 "NO"
)&lt;/LI-CODE&gt;&lt;P&gt;________________________&lt;/P&gt;&lt;P&gt;If my answer was helpful, please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&lt;I&gt; to help the other members find it&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Click on the &lt;STRONG&gt;Thumbs-Up icon &lt;/STRONG&gt;if you like this reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/channel/UCKwBEguA8IlBubIobaOormg?sub_confirmation=1" target="_blank"&gt;&lt;FONT color="blue"&gt;YouTube&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp; &lt;A href="https://linkedin.com/in/fowmy" target="_blank"&gt;&lt;FONT color="blue"&gt;LinkedIn&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Sep 2020 19:46:00 GMT</pubDate>
    <dc:creator>Fowmy</dc:creator>
    <dc:date>2020-09-22T19:46:00Z</dc:date>
    <item>
      <title>DAX Switch statement error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-statement-error/m-p/1388222#M25388</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Column1 = SWITCH(True(),[ID] = "FH20-10","YES",[ID] = "FA30-10","YES",[ID] = "FA60-20","YES","NO")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a caluclated column named "Column1" and is getting this error :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Function 'SWITCH' does not support comparing values of type Text with values of type True/False. Consider using the VALUE or FORMAT function to convert one of the values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be highly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 19:14:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-statement-error/m-p/1388222#M25388</guid>
      <dc:creator>im_newbie_123</dc:creator>
      <dc:date>2020-09-22T19:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Switch statement error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-statement-error/m-p/1388261#M25391</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="178884" data-lia-user-login="im_newbie_123" class="lia-mention lia-mention-user"&gt;im_newbie_123&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;It seems your column [ID] returns a nontext value and you are comparing with text. You can convert to the text value and do the SWTICHCH like&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Column1 = 
VAR X = FORMAT([ID],"@") RETURN
SWITCH(True(),
 X = "FH20-10","YES",
 X = "FA30-10","YES",
 X = "FA60-20","YES",
 "NO"
)&lt;/LI-CODE&gt;&lt;P&gt;________________________&lt;/P&gt;&lt;P&gt;If my answer was helpful, please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&lt;I&gt; to help the other members find it&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Click on the &lt;STRONG&gt;Thumbs-Up icon &lt;/STRONG&gt;if you like this reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/channel/UCKwBEguA8IlBubIobaOormg?sub_confirmation=1" target="_blank"&gt;&lt;FONT color="blue"&gt;YouTube&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp; &lt;A href="https://linkedin.com/in/fowmy" target="_blank"&gt;&lt;FONT color="blue"&gt;LinkedIn&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 19:46:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-statement-error/m-p/1388261#M25391</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2020-09-22T19:46:00Z</dc:date>
    </item>
  </channel>
</rss>

