<?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 Calculate if statement in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Calculate-if-statement/m-p/705882#M915</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="141267" data-lia-user-login="jemartin" class="lia-mention lia-mention-user"&gt;jemartin&lt;/a&gt; add new&amp;nbsp;&lt;EM&gt;column&lt;/EM&gt; using following expression:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;HVIS = 
SWITCH( &lt;BR /&gt;TRUE(),
Table[Sales Price] &amp;gt; 0, Table[Sales Price] * Table[Qty],
Table[Sales Price] = 0 &amp;amp;&amp;amp; Table[Budget Price] = 0,  Table[Material Cost] * 0.3 * Table[Qty],
Table[Sales Price] = 0, Table[Budget Price] * Table[Qty]
)

&lt;/PRE&gt;
&lt;P&gt;change column name and table name as per your data model. You can also achieve it with&amp;nbsp;&lt;EM&gt;IF&lt;/EM&gt; but&amp;nbsp;&lt;EM&gt;Switch&lt;/EM&gt; is easy to change/read.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jun 2019 19:56:01 GMT</pubDate>
    <dc:creator>parry2k</dc:creator>
    <dc:date>2019-06-03T19:56:01Z</dc:date>
    <item>
      <title>DAX Calculate if statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Calculate-if-statement/m-p/705866#M914</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am pretty new with DAX and struggling to translate this excel formula into DAX format.&lt;/P&gt;&lt;P&gt;I want to calculate the Value based on the criteria;&lt;/P&gt;&lt;P&gt;Sales price * qty&amp;nbsp; &amp;nbsp;(where Sales price &amp;gt;0)&lt;/P&gt;&lt;P&gt;Budget price * qty&amp;nbsp; (if Sales price = 0)&lt;/P&gt;&lt;P&gt;Material cost *30% * qty&amp;nbsp; (if Sales price =0 and Budget price = 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In excel it looks like this:&lt;/P&gt;&lt;P&gt;=IF(H119&amp;gt;0;H119*L119;IF(I119&amp;gt;0;I119*L119;(G119*1,3)*L119))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 19:27:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Calculate-if-statement/m-p/705866#M914</guid>
      <dc:creator>jemartin</dc:creator>
      <dc:date>2019-06-03T19:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Calculate if statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Calculate-if-statement/m-p/705882#M915</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="141267" data-lia-user-login="jemartin" class="lia-mention lia-mention-user"&gt;jemartin&lt;/a&gt; add new&amp;nbsp;&lt;EM&gt;column&lt;/EM&gt; using following expression:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;HVIS = 
SWITCH( &lt;BR /&gt;TRUE(),
Table[Sales Price] &amp;gt; 0, Table[Sales Price] * Table[Qty],
Table[Sales Price] = 0 &amp;amp;&amp;amp; Table[Budget Price] = 0,  Table[Material Cost] * 0.3 * Table[Qty],
Table[Sales Price] = 0, Table[Budget Price] * Table[Qty]
)

&lt;/PRE&gt;
&lt;P&gt;change column name and table name as per your data model. You can also achieve it with&amp;nbsp;&lt;EM&gt;IF&lt;/EM&gt; but&amp;nbsp;&lt;EM&gt;Switch&lt;/EM&gt; is easy to change/read.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 19:56:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Calculate-if-statement/m-p/705882#M915</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2019-06-03T19:56:01Z</dc:date>
    </item>
  </channel>
</rss>

