<?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 Correct DAX syntax for using SWITCH and Contains together. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correct-DAX-syntax-for-using-SWITCH-and-Contains-together/m-p/3678589#M142837</link>
    <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;New to the forum and Power Bi.&amp;nbsp; I am currently trying to figure out how to classify various codes to Products in my query.&amp;nbsp; The trick is that some codes are utilized expressly for a given product while for others variations are used. A nested IF may be a possibility, but I am currently trying to use SWITCH in conjunction with "Contains" for the cases where a variation of the code is being used.&amp;nbsp; Here is an excerpt on how i currently have the DAX formula set up:&lt;/P&gt;&lt;P&gt;SWITCH(TRUE(),&lt;/P&gt;&lt;P&gt;'Code Load'[Billing ID]="ESEAT3", "Seats",&lt;/P&gt;&lt;P&gt;'Code Load'[Billing ID]Contains "EECI", "Superior Svc"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently getting an error on synatax for "Contains".&amp;nbsp; Any insight would be appreciated.&amp;nbsp; Thanks all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 04 Feb 2024 17:26:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-02-04T17:26:22Z</dc:date>
    <item>
      <title>Correct DAX syntax for using SWITCH and Contains together.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correct-DAX-syntax-for-using-SWITCH-and-Contains-together/m-p/3678589#M142837</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;New to the forum and Power Bi.&amp;nbsp; I am currently trying to figure out how to classify various codes to Products in my query.&amp;nbsp; The trick is that some codes are utilized expressly for a given product while for others variations are used. A nested IF may be a possibility, but I am currently trying to use SWITCH in conjunction with "Contains" for the cases where a variation of the code is being used.&amp;nbsp; Here is an excerpt on how i currently have the DAX formula set up:&lt;/P&gt;&lt;P&gt;SWITCH(TRUE(),&lt;/P&gt;&lt;P&gt;'Code Load'[Billing ID]="ESEAT3", "Seats",&lt;/P&gt;&lt;P&gt;'Code Load'[Billing ID]Contains "EECI", "Superior Svc"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently getting an error on synatax for "Contains".&amp;nbsp; Any insight would be appreciated.&amp;nbsp; Thanks all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2024 17:26:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correct-DAX-syntax-for-using-SWITCH-and-Contains-together/m-p/3678589#M142837</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-04T17:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Correct DAX syntax for using SWITCH and Contains together.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correct-DAX-syntax-for-using-SWITCH-and-Contains-together/m-p/3678608#M142840</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/containsstring-function-dax?wt.mc_id=DP-MVP-5004989" target="_blank"&gt;CONTAINSSTRING function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Expected result CC = 
SWITCH (
    TRUE (),
    'Code Load'[Billing ID] = "ESEAT3", "Seats",
    CONTAINSSTRING ( 'Code Load'[Billing ID], "EECI" ), "Superior Svc"
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2024 17:59:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correct-DAX-syntax-for-using-SWITCH-and-Contains-together/m-p/3678608#M142840</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-02-04T17:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Correct DAX syntax for using SWITCH and Contains together.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correct-DAX-syntax-for-using-SWITCH-and-Contains-together/m-p/3678666#M142841</link>
      <description>&lt;P&gt;This looks very good.&amp;nbsp; Question, how do i next the CONTAINSSTRING to utilize with multiple codes?&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2024 18:50:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correct-DAX-syntax-for-using-SWITCH-and-Contains-together/m-p/3678666#M142841</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-04T18:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Correct DAX syntax for using SWITCH and Contains together.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correct-DAX-syntax-for-using-SWITCH-and-Contains-together/m-p/3678699#M142844</link>
      <description>&lt;P&gt;Disregard my earlier send re useing CONTAINS in a nested statement.&amp;nbsp; Your solution works PERFECTLY.&amp;nbsp; Thanks for the quick response!!!&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2024 19:22:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correct-DAX-syntax-for-using-SWITCH-and-Contains-together/m-p/3678699#M142844</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-04T19:22:02Z</dc:date>
    </item>
  </channel>
</rss>

