<?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: Help Converting Excel Formula to DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Converting-Excel-Formula-to-DAX/m-p/4109454#M163080</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;Technically the same IF syntax should technically work in DAX. That said, a SWITCH( TRUE(), ... ) statement would be preferred. That's a lot of nested IF statements though. It's hard to decipher with the poor formatting so I would start by properly formatting the IF statements and then it should be easier to figure out the logic.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Aug 2024 14:51:08 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2024-08-20T14:51:08Z</dc:date>
    <item>
      <title>Help Converting Excel Formula to DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Converting-Excel-Formula-to-DAX/m-p/4109444#M163079</link>
      <description>&lt;P&gt;Could someone please help me convert this excel formula to DAX? I was thinking I could use the Switch function but I am having trouble formatting it correctly.&lt;BR /&gt;&lt;BR /&gt;IF([@InvoiceDate]&amp;gt;DATE(2020,12,31),&lt;BR /&gt;(IF([@[ProductType_Sub3]]="monthly",([@ExtensionAmt]*72),&lt;BR /&gt;(IF([@[ProductType_Sub3]]="yearly",([@ExtensionAmt]*6),&lt;BR /&gt;(IF([@[ProductType_Sub3]]="5 Year",([@ExtensionAmt]/5)*6,&lt;BR /&gt;(IF([@[ProductType_Sub3]]="4 Year",([@ExtensionAmt]/4)*6,&lt;BR /&gt;(IF([@[ProductType_Sub3]]="3 Year",([@ExtensionAmt]/3)*6,&lt;BR /&gt;(IF([@[ProductType_Sub3]]="2 Year",([@ExtensionAmt]/2)*6,)))))))))))),&lt;BR /&gt;(IF([@[ProductType_Sub3]]="monthly",([@ExtensionAmt]*36),&lt;BR /&gt;(IF([@[ProductType_Sub3]]="yearly",([@ExtensionAmt]*3),"")))))&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 14:48:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Converting-Excel-Formula-to-DAX/m-p/4109444#M163079</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-20T14:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help Converting Excel Formula to DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Converting-Excel-Formula-to-DAX/m-p/4109454#M163080</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;Technically the same IF syntax should technically work in DAX. That said, a SWITCH( TRUE(), ... ) statement would be preferred. That's a lot of nested IF statements though. It's hard to decipher with the poor formatting so I would start by properly formatting the IF statements and then it should be easier to figure out the logic.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 14:51:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Converting-Excel-Formula-to-DAX/m-p/4109454#M163080</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-08-20T14:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help Converting Excel Formula to DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Converting-Excel-Formula-to-DAX/m-p/4109511#M163082</link>
      <description>&lt;P&gt;Try:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IF([InvoiceDate] &amp;gt; DATE(2020, 12, 31),
SWITCH( TRUE,
    [ProductType_Sub3] = "monthly", ([ExtensionAmt * 72),
    [ProductType_Sub3] = "yearly", ([ExtensionAmt * 6),
    [ProductType_Sub3] = "5 Year", (([ExtensionAmt / 5) * 6),
    [ProductType_Sub3] = "4 Year", (([ExtensionAmt / 4) * 6),
    [ProductType_Sub3] = "3 Year", (([ExtensionAmt / 3) * 6),
    [ProductType_Sub3] = "2 Year", (([ExtensionAmt / 2) * 6),
    FALSE),
SWITCH(TRUE,
    [ProductType_Sub3] = "monthly", ([ExtensionAmt * 36),
    [ProductType_Sub3] = "yearly", ([ExtensionAmt * 3),
    FALSE
))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;&lt;EM&gt;think&amp;nbsp;&lt;/EM&gt;captured what the formula's trying to do. You might have to monkey with it to get it to fit. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 15:20:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Converting-Excel-Formula-to-DAX/m-p/4109511#M163082</guid>
      <dc:creator>Brightsider</dc:creator>
      <dc:date>2024-08-20T15:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help Converting Excel Formula to DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Converting-Excel-Formula-to-DAX/m-p/4113219#M163238</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&amp;nbsp;hello, Brightsider&amp;nbsp;&amp;amp; Greg_Deckler&amp;nbsp;, thank you for your promot reply!&lt;BR /&gt;&lt;BR /&gt;We could also use the following measure to meet your requirement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Result = 
SWITCH(
    TRUE(),
    SELECTEDVALUE('Table'[InvoiceDate])&amp;gt; DATE(2020, 12, 31),
        SWITCH(
            TRUE(),
            SELECTEDVALUE('Table'[ProductType_Sub3]) = "monthly", SELECTEDVALUE('Table'[ExtensionAmt]) * 72,
            SELECTEDVALUE('Table'[ProductType_Sub3]) = "yearly", SELECTEDVALUE('Table'[ExtensionAmt]) * 6,
            SELECTEDVALUE('Table'[ProductType_Sub3]) = "5 Year", (SELECTEDVALUE('Table'[ExtensionAmt]) / 5) * 6,
            SELECTEDVALUE('Table'[ProductType_Sub3]) = "4 Year", (SELECTEDVALUE('Table'[ExtensionAmt]) / 4) * 6,
            SELECTEDVALUE('Table'[ProductType_Sub3])= "3 Year", (SELECTEDVALUE('Table'[ExtensionAmt]) / 3) * 6,
            SELECTEDVALUE('Table'[ProductType_Sub3]) = "2 Year", (SELECTEDVALUE('Table'[ExtensionAmt]) / 2) * 6,
            BLANK()
        ),
   SELECTEDVALUE('Table'[ProductType_Sub3]) = "monthly", SELECTEDVALUE('Table'[ExtensionAmt]) * 36,
    SELECTEDVALUE('Table'[ProductType_Sub3]) = "yearly", SELECTEDVALUE('Table'[ExtensionAmt]) * 3,
    BLANK()
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Joyce&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 09:43:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Converting-Excel-Formula-to-DAX/m-p/4113219#M163238</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-22T09:43:08Z</dc:date>
    </item>
  </channel>
</rss>

