<?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: measure with multiple if statements in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/measure-with-multiple-if-statements/m-p/2453074#M66099</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="372584" data-lia-user-login="fisqkuz1" class="lia-mention lia-mention-user"&gt;fisqkuz1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I don't fully understand your If - Else statement but you may try the following&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Revenue or Cost =
SUMX (
    table,
    IF (
        table[col] = "short" &amp;amp; table[col2] &amp;gt; 0,
        2,
        IF ( table[col] = "long" &amp;amp; table[col2] &amp;gt; 0, 1, 2 )
    )
)&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 12 Apr 2022 16:19:38 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-04-12T16:19:38Z</dc:date>
    <item>
      <title>measure with multiple if statements</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/measure-with-multiple-if-statements/m-p/2453057#M66098</link>
      <description>&lt;P&gt;hi all&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;coming from a python background, i am trying to get the hang of dax.&lt;/P&gt;&lt;P&gt;however I am having trouble with the following attempt:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Revenue or Cost = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;table[col]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"short"&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;table[col2]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ELIF(table[col] = "long" &amp;amp; table[col2] &amp;gt; 0, 1, 2&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ELSE&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;i can't figure out how to get this in a simple measure rather than a new column&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 12 Apr 2022 16:11:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/measure-with-multiple-if-statements/m-p/2453057#M66098</guid>
      <dc:creator>fisqkuz1</dc:creator>
      <dc:date>2022-04-12T16:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: measure with multiple if statements</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/measure-with-multiple-if-statements/m-p/2453074#M66099</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="372584" data-lia-user-login="fisqkuz1" class="lia-mention lia-mention-user"&gt;fisqkuz1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I don't fully understand your If - Else statement but you may try the following&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Revenue or Cost =
SUMX (
    table,
    IF (
        table[col] = "short" &amp;amp; table[col2] &amp;gt; 0,
        2,
        IF ( table[col] = "long" &amp;amp; table[col2] &amp;gt; 0, 1, 2 )
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 12 Apr 2022 16:19:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/measure-with-multiple-if-statements/m-p/2453074#M66099</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-04-12T16:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: measure with multiple if statements</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/measure-with-multiple-if-statements/m-p/2453090#M66101</link>
      <description>&lt;P&gt;hi, thanks for your answer!&lt;/P&gt;&lt;P&gt;i want to simply get a 1 or 2 as output such as booleans&lt;/P&gt;&lt;P&gt;where 1 = revenue and 2 = cost&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 16:23:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/measure-with-multiple-if-statements/m-p/2453090#M66101</guid>
      <dc:creator>fisqkuz1</dc:creator>
      <dc:date>2022-04-12T16:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: measure with multiple if statements</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/measure-with-multiple-if-statements/m-p/2453099#M66102</link>
      <description>&lt;P&gt;The you use the sane logic. Only last oart shall not be required&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Revenue or Cost =
SUMX (
    table,
    IF (
        table[col] = "short" &amp;amp; table[col2] &amp;gt; 0,
        table[Revenue],
        IF ( table[col] = "long" &amp;amp; table[col2] &amp;gt; 0, table[Cost] )
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 12 Apr 2022 16:26:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/measure-with-multiple-if-statements/m-p/2453099#M66102</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-04-12T16:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: measure with multiple if statements</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/measure-with-multiple-if-statements/m-p/2462887#M66767</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="372584" data-lia-user-login="fisqkuz1" class="lia-mention lia-mention-user"&gt;fisqkuz1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try measure formula like the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
var _col=MAX('Table'[col])
var _col2=MAX('Table'[col2])
return 
SWITCH(TRUE(),
    _col="short"&amp;amp;&amp;amp;_col2&amp;gt;0,2,
    _col="short"&amp;amp;&amp;amp;_col2&amp;lt;&amp;gt;0,1,
    _col="long"&amp;amp;&amp;amp;_col2&amp;gt;0,1,
    _col="long"&amp;amp;&amp;amp;_col2&amp;lt;&amp;gt;0,2,
    2
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it doesn't work, pelase share your sample data and expected result in excel.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Eason&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 07:49:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/measure-with-multiple-if-statements/m-p/2462887#M66767</guid>
      <dc:creator>v-easonf-msft</dc:creator>
      <dc:date>2022-04-19T07:49:14Z</dc:date>
    </item>
  </channel>
</rss>

