<?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: Using switch in M in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-switch-in-M/m-p/876543#M7368</link>
    <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="176914" data-lia-user-login="AU555" class="lia-mention lia-mention-user"&gt;AU555&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;you can try something like this, try adding a custom column with the following code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if [C1] = null then [C1_1]&lt;/P&gt;
&lt;P&gt;else&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; if [C2] = null then [C2_1]&lt;/P&gt;
&lt;P&gt;else&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if [C3] = null then [C3_1]&lt;/P&gt;
&lt;P&gt;&amp;nbsp; else [C4]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This would be equivalent to the following. IUse this pattern to build exactly what you need&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ColumnName = SWITCH(&lt;/P&gt;
&lt;P&gt;TRUE();&lt;/P&gt;
&lt;P&gt;'table1'[C1]&amp;lt;&amp;gt; BLANK(); 'table1'[C1_1];&lt;/P&gt;
&lt;P&gt;'table1'[C2] &amp;lt;&amp;gt; BLANK(); 'table1'[C2_1];&lt;/P&gt;
&lt;P&gt;'table1'[C3]&amp;lt;&amp;gt; BLANK(); 'table1'[C3_1];&lt;/P&gt;
&lt;P&gt;'table1'[C4])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving kudos &lt;/FONT&gt;if posts are helpful.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&amp;nbsp;&lt;IMG src="https://community.fabric.microsoft.com/html/badge_icons/SU18_powerbi_badge.png" border="0" alt="Datanaut" width="64" height="64" /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Dec 2019 16:27:26 GMT</pubDate>
    <dc:creator>AlB</dc:creator>
    <dc:date>2019-12-16T16:27:26Z</dc:date>
    <item>
      <title>Using switch in M</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-switch-in-M/m-p/876331#M7363</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have an easy problem, but as I am a beginner i M I have a bit proglem with this. I have the following calculation in dax swithing between several dates. However, I need to make the same calculation in power query and what i have been trying is not working does not pull the dates correctly:&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have following:&lt;/P&gt;&lt;P&gt;Date = SWITCH(&lt;/P&gt;&lt;P&gt;TRUE();&lt;/P&gt;&lt;P&gt;'table1'[Real Finish]&amp;lt;&amp;gt; BLANK(); 'table1'[Real Finish];&lt;/P&gt;&lt;P&gt;'table1'[Remaining Finish] &amp;lt;&amp;gt; BLANK(); 'table1'[Remaining Finish];&lt;/P&gt;&lt;P&gt;'table1'[Actual Finish]&amp;lt;&amp;gt; BLANK(); 'table1'[Actual Finish];&lt;/P&gt;&lt;P&gt;'table1'[Real Start]&amp;lt;&amp;gt; BLANK(); 'table1'[Real Start];&lt;/P&gt;&lt;P&gt;'table1'[Remaining Start] &amp;lt;&amp;gt; BLANK(); 'table1'[Remaining Start];&lt;/P&gt;&lt;P&gt;'table1'[Actual Start])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can some of you help me with this?&lt;/P&gt;&lt;P&gt;Thank you for your time,&lt;/P&gt;&lt;P&gt;Anastasia&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 12:45:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-switch-in-M/m-p/876331#M7363</guid>
      <dc:creator>AU555</dc:creator>
      <dc:date>2019-12-16T12:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using switch in M</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-switch-in-M/m-p/876543#M7368</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="176914" data-lia-user-login="AU555" class="lia-mention lia-mention-user"&gt;AU555&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;you can try something like this, try adding a custom column with the following code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if [C1] = null then [C1_1]&lt;/P&gt;
&lt;P&gt;else&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; if [C2] = null then [C2_1]&lt;/P&gt;
&lt;P&gt;else&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if [C3] = null then [C3_1]&lt;/P&gt;
&lt;P&gt;&amp;nbsp; else [C4]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This would be equivalent to the following. IUse this pattern to build exactly what you need&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ColumnName = SWITCH(&lt;/P&gt;
&lt;P&gt;TRUE();&lt;/P&gt;
&lt;P&gt;'table1'[C1]&amp;lt;&amp;gt; BLANK(); 'table1'[C1_1];&lt;/P&gt;
&lt;P&gt;'table1'[C2] &amp;lt;&amp;gt; BLANK(); 'table1'[C2_1];&lt;/P&gt;
&lt;P&gt;'table1'[C3]&amp;lt;&amp;gt; BLANK(); 'table1'[C3_1];&lt;/P&gt;
&lt;P&gt;'table1'[C4])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving kudos &lt;/FONT&gt;if posts are helpful.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&amp;nbsp;&lt;IMG src="https://community.fabric.microsoft.com/html/badge_icons/SU18_powerbi_badge.png" border="0" alt="Datanaut" width="64" height="64" /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 16:27:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-switch-in-M/m-p/876543#M7368</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2019-12-16T16:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using switch in M</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-switch-in-M/m-p/877385#M7400</link>
      <description>&lt;P&gt;I am a bit confused: this calculation in DAX says: if C1 is not blank, use C1_1, if C2 is not blank, use C2_1 (&amp;lt;&amp;gt; is no eqal to)&lt;/P&gt;&lt;P&gt;ColumnName = SWITCH(&lt;/P&gt;&lt;P&gt;TRUE();&lt;/P&gt;&lt;P&gt;'table1'[C1]&amp;lt;&amp;gt; BLANK(); 'table1'[C1_1];&lt;/P&gt;&lt;P&gt;'table1'[C2] &amp;lt;&amp;gt; BLANK(); 'table1'[C2_1];&lt;/P&gt;&lt;P&gt;'table1'[C3]&amp;lt;&amp;gt; BLANK(); 'table1'[C3_1];&lt;/P&gt;&lt;P&gt;'table1'[C4])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and the calculation in M:&amp;nbsp;&lt;/P&gt;&lt;P&gt;if [C1] = null then [C1_1]&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if [C2] = null then [C2_1]&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;&amp;nbsp; if [C3] = null then [C3_1]&lt;/P&gt;&lt;P&gt;&amp;nbsp; else [C4]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;says, if C1 is null then use C1_1, is C2 is null then use C2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I need calculation saying, If C1 is not blank use C1, if C1 is blank use C2, if C2 is not blank use C2, if C2 is blank use C3 etc....&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 10:01:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-switch-in-M/m-p/877385#M7400</guid>
      <dc:creator>AU555</dc:creator>
      <dc:date>2019-12-17T10:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using switch in M</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-switch-in-M/m-p/877585#M7418</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="176914" data-lia-user-login="AU555" class="lia-mention lia-mention-user"&gt;AU555&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're right. Make it &amp;lt;&amp;gt; null in all cases instead of&amp;nbsp;&amp;nbsp;&amp;nbsp; = null&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving kudos &lt;/FONT&gt;if posts are helpful.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&amp;nbsp;&lt;IMG src="https://community.fabric.microsoft.com/html/badge_icons/SU18_powerbi_badge.png" border="0" alt="Datanaut" width="64" height="64" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 12:46:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-switch-in-M/m-p/877585#M7418</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2019-12-17T12:46:24Z</dc:date>
    </item>
  </channel>
</rss>

