<?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 but using containsstring in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-switch-but-using-containsstring/m-p/4804850#M183794</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="927611" data-lia-user-login="JK-1" class="lia-mention lia-mention-user"&gt;JK-1&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Did you get a chance to try the&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1265350" data-lia-user-login="Shahid12523" class="lia-mention lia-mention-user"&gt;Shahid12523&lt;/a&gt;&amp;nbsp; suggestion with CONTAINSSTRING inside SWITCH(TRUE())? It should work as expected for example, "South Region" would correctly return 30. Just note that if a name contains more than one of the keywords (like "NorthEast"), the formula will stop at the first match it finds, so only "North" would be applied in that case. Otherwise, the approach should give you the results you’re looking for.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Akhil.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Aug 2025 10:18:29 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-08-22T10:18:29Z</dc:date>
    <item>
      <title>DAX switch but using containsstring</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-switch-but-using-containsstring/m-p/4804267#M183761</link>
      <description>&lt;P&gt;Is there a way to have CONTAINSSTRING in the below instead, as using IN as part of the VAR _Name requires an exact, and I have some examples elsewhere where it would be easier to use containsstring. I've tried a few different IF CONTAINSSTRING in places, and substituted TRUE but can't get it to work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result = VAR _Name = 'Table1'[Name]&lt;BR /&gt;RETURN&lt;BR /&gt;SWITCH(&lt;BR /&gt;TRUE(),&lt;BR /&gt;_Name IN {"South"},&lt;BR /&gt;"30",&lt;BR /&gt;_Name IN {"North"},&lt;BR /&gt;"28",&lt;BR /&gt;_Name IN {"East"},&lt;BR /&gt;"22",&lt;BR /&gt;_Name IN {"West"},&lt;BR /&gt;"20",&lt;BR /&gt;""&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 23:29:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-switch-but-using-containsstring/m-p/4804267#M183761</guid>
      <dc:creator>JK-1</dc:creator>
      <dc:date>2025-08-21T23:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: DAX switch but using containsstring</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-switch-but-using-containsstring/m-p/4804341#M183763</link>
      <description>&lt;P&gt;Yes — replace IN with CONTAINSSTRING inside SWITCH(TRUE())&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result =&lt;BR /&gt;VAR _Name = 'Table1'[Name]&lt;BR /&gt;RETURN&lt;BR /&gt;SWITCH(&lt;BR /&gt;TRUE(),&lt;BR /&gt;CONTAINSSTRING(_Name, "South"), "30",&lt;BR /&gt;CONTAINSSTRING(_Name, "North"), "28",&lt;BR /&gt;CONTAINSSTRING(_Name, "East"), "22",&lt;BR /&gt;CONTAINSSTRING(_Name, "West"), "20",&lt;BR /&gt;""&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 22 Aug 2025 02:42:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-switch-but-using-containsstring/m-p/4804341#M183763</guid>
      <dc:creator>Shahid12523</dc:creator>
      <dc:date>2025-08-22T02:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: DAX switch but using containsstring</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-switch-but-using-containsstring/m-p/4804850#M183794</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="927611" data-lia-user-login="JK-1" class="lia-mention lia-mention-user"&gt;JK-1&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Did you get a chance to try the&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1265350" data-lia-user-login="Shahid12523" class="lia-mention lia-mention-user"&gt;Shahid12523&lt;/a&gt;&amp;nbsp; suggestion with CONTAINSSTRING inside SWITCH(TRUE())? It should work as expected for example, "South Region" would correctly return 30. Just note that if a name contains more than one of the keywords (like "NorthEast"), the formula will stop at the first match it finds, so only "North" would be applied in that case. Otherwise, the approach should give you the results you’re looking for.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Akhil.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Aug 2025 10:18:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-switch-but-using-containsstring/m-p/4804850#M183794</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-08-22T10:18:29Z</dc:date>
    </item>
  </channel>
</rss>

