<?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: I think I can use Switch.... in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-think-I-can-use-Switch/m-p/967819#M11513</link>
    <description>You can achieve same in dax using stringcontains function and switch statement.&lt;BR /&gt;New column=Switch(true(), stringcontains (table[col],"string1"), "expected output",&lt;BR /&gt;stringcontains (table[col],"string2"), "outut",table[expectedColumn])&lt;BR /&gt;&lt;BR /&gt;But my recommendation is create it in power query for the better performance.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Pravin&lt;BR /&gt;</description>
    <pubDate>Wed, 11 Mar 2020 02:28:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-03-11T02:28:30Z</dc:date>
    <item>
      <title>I think I can use Switch....</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-think-I-can-use-Switch/m-p/967681#M11505</link>
      <description>&lt;P&gt;Hello all - as always, thank you very much - in advance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a nutshell I would like to know if I there is a function in DAX that works the same as a the below Excel formula.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=&lt;BR /&gt;IF(ISNUMBER(SEARCH("AMASale",[@[Partners]])),"Amazon",&lt;BR /&gt;IF(ISNUMBER(SEARCH("CstcSale",[@[Partners]])),"Costco",[@[Non-Partners]]))))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What the formula is doing is looking at the Partners column and for each cell (row) it is returning "Amazon" if within the string it says AMASale and "Costco" if within the string it says CstcSale. If nothing is found (meaning no AMASale or CstcSale) then it will return what ever is listed in the Non-Partners cell.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;If you are all familiar with Excel, apologies for the explanation.&lt;BR /&gt;&lt;BR /&gt;Is there a way for me to do something similar in PBI Desktop? I am thinking within PQE, add a new column and reference the columns I need but I am not sure on the correct DAX to use. Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class="ics-element-donot-delete 1001_CC@"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 22:39:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-think-I-can-use-Switch/m-p/967681#M11505</guid>
      <dc:creator>josevaras</dc:creator>
      <dc:date>2020-03-10T22:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: I think I can use Switch....</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-think-I-can-use-Switch/m-p/967712#M11507</link>
      <description>&lt;P&gt;PQE?&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Is this Power Query?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, add a column with this code&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;if Text.Contains([Column1], "AMASale") then "Amazon" else if Text.Contains([Column1], "CstcSale") then "Costco" else [theothercolumn]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2020 00:35:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-think-I-can-use-Switch/m-p/967712#M11507</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2020-03-11T00:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: I think I can use Switch....</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-think-I-can-use-Switch/m-p/967819#M11513</link>
      <description>You can achieve same in dax using stringcontains function and switch statement.&lt;BR /&gt;New column=Switch(true(), stringcontains (table[col],"string1"), "expected output",&lt;BR /&gt;stringcontains (table[col],"string2"), "outut",table[expectedColumn])&lt;BR /&gt;&lt;BR /&gt;But my recommendation is create it in power query for the better performance.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Pravin&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Mar 2020 02:28:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-think-I-can-use-Switch/m-p/967819#M11513</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-11T02:28:30Z</dc:date>
    </item>
  </channel>
</rss>

