<?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: Regarding a (specific) nested IF formula results in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regarding-a-specific-nested-IF-formula-results/m-p/2620504#M76293</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="409099" data-lia-user-login="EsgibtkeinBier" class="lia-mention lia-mention-user"&gt;EsgibtkeinBier&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wouldn't even try to understand it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I would rewrite it using SWITCH instead of IF's. If you start rewriting it, you'll sooner or later understand everything about it. That's the by-product of making code clearer with the correct structures.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jul 2022 16:49:37 GMT</pubDate>
    <dc:creator>daXtreme</dc:creator>
    <dc:date>2022-07-05T16:49:37Z</dc:date>
    <item>
      <title>Regarding a (specific) nested IF formula results</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regarding-a-specific-nested-IF-formula-results/m-p/2620483#M76291</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hey everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering how the following formula produces results for dates &amp;gt;&amp;nbsp;(2021,3,1), since I can't wrap my head around how it handles stuff after the aforementioned date! Thank you for your time!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I =&lt;/P&gt;&lt;P&gt;IF('Overview'[Date] &amp;lt; Date(2020,4,1),&lt;BR /&gt;&amp;nbsp; IF('Overview'[Buyer Type]="A",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; IF('Overview'[Auction Type]="O",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Divide(Overview[r],76)*100*0.21,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Divide(Overview[r],85)*100*0.11),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Divide(Overview[r],73)*100*0.20),&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;IF('Overview'[Date] &amp;lt; Date(2020,6,1),&lt;BR /&gt;&amp;nbsp; IF('Overview'[Buyer Type]="A",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; IF('Overview'[Auction Type]="O",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Divide(Overview[r],77)*100*0.20,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Divide(Overview[r],87)*100*0.1),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Divide(Overview[r],74)*100*0.20),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF('Overview'[Date] &amp;lt; Date(2020,11,1),&lt;BR /&gt;&amp;nbsp; IF('Overview'[Buyer Type]="A",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; IF('Overview'[Auction Type]="O",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Divide(Overview[r],73.5)*100*0.235,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Divide(Overview[r],87)*100*0.1),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Divide(Overview[r],70.5)*100*0.235),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF(Overview[Date] &amp;lt; date(2021,3,1),&lt;BR /&gt;&amp;nbsp; IF(Overview[Publisher]="E",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 0,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; IF(Overview[A]="A",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DIVIDE(Overview[r],87)*100*0.13,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Divide(Overview[i],500)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;BR /&gt;&amp;nbsp; &amp;nbsp; )&lt;BR /&gt;&amp;nbsp; ,&lt;BR /&gt;&amp;nbsp; IF(Overview[Publisher]="E",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 0,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; IF(Overview[A]="A",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DIVIDE(Overview[r],87)*100*0.13,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If(Overview[A]="V",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DIVIDE(Overview[i],250),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Divide(Overview[i],500)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;BR /&gt;&amp;nbsp; &amp;nbsp; )&lt;BR /&gt;)))))&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 16:42:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regarding-a-specific-nested-IF-formula-results/m-p/2620483#M76291</guid>
      <dc:creator>EsgibtkeinBier</dc:creator>
      <dc:date>2022-07-05T16:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding a (specific) nested IF formula results</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regarding-a-specific-nested-IF-formula-results/m-p/2620504#M76293</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="409099" data-lia-user-login="EsgibtkeinBier" class="lia-mention lia-mention-user"&gt;EsgibtkeinBier&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wouldn't even try to understand it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I would rewrite it using SWITCH instead of IF's. If you start rewriting it, you'll sooner or later understand everything about it. That's the by-product of making code clearer with the correct structures.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 16:49:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regarding-a-specific-nested-IF-formula-results/m-p/2620504#M76293</guid>
      <dc:creator>daXtreme</dc:creator>
      <dc:date>2022-07-05T16:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding a (specific) nested IF formula results</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regarding-a-specific-nested-IF-formula-results/m-p/2626513#M76672</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="409099" data-lia-user-login="EsgibtkeinBier" class="lia-mention lia-mention-user"&gt;EsgibtkeinBier&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="349489" data-lia-user-login="daXtreme" class="lia-mention lia-mention-user"&gt;daXtreme&lt;/a&gt;&amp;nbsp;said, when you have multiple nests, it is better to use SWITCHE function instead of IF function .&amp;nbsp;In terms of execution speed, SWITCHE is faster than IF . And SWITCHE is easier to edit and have a clear hierarchy.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.scaler.com/topics/c/difference-between-if-else-and-switch/" target="_blank"&gt;https://www.scaler.com/topics/c/difference-between-if-else-and-switch/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Ailsa Tao&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 02:26:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regarding-a-specific-nested-IF-formula-results/m-p/2626513#M76672</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-08T02:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding a (specific) nested IF formula results</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regarding-a-specific-nested-IF-formula-results/m-p/2671132#M79666</link>
      <description>&lt;P&gt;Thanks everyone for suggesting to use SWITCH, as it makes sense both in terms of performance and clarity! However, this does not answer the question of how&amp;nbsp;&lt;SPAN&gt;dates &amp;gt;&amp;nbsp;(2021,3,1) are handled&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With a careful look at the expression above, one can see that only the last logical test involving dates&amp;nbsp;has an &lt;EM&gt;else&lt;/EM&gt; statement, therefore, all dates after the 1st of March 2021, are handled by this part of the expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; IF(Overview[Publisher]="E",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 0,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; IF(Overview[A]="A",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DIVIDE(Overview[r],87)*100*0.13,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If(Overview[A]="V",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DIVIDE(Overview[i],250),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Divide(Overview[i],500)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2022 14:21:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regarding-a-specific-nested-IF-formula-results/m-p/2671132#M79666</guid>
      <dc:creator>EsgibtkeinBier</dc:creator>
      <dc:date>2022-07-31T14:21:33Z</dc:date>
    </item>
  </channel>
</rss>

