<?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 Measure using IF column and AND measure = in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-using-IF-column-and-AND-measure/m-p/3147112#M112613</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;New to the world of DAX after years of using Microstrategy and Qlik.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm struggling to get my head around a few calculations/statements. Would someone be able to assist with my current issue:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if("MARKET" = 'CN' and "Value" &amp;lt; 0.001, 0,&lt;BR /&gt;if("MARKET" = 'JP' and "Value" &amp;lt; 0.001,0,&lt;BR /&gt;"Tot_gross")) as "Gross"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Market, Value and Tot_gross are all in the same table. When i try to calculate a new measure using the IF statement it doesn't let me select the neccessry column (in this case 'Market')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am i doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Mar 2023 12:15:23 GMT</pubDate>
    <dc:creator>jrdwthomas</dc:creator>
    <dc:date>2023-03-22T12:15:23Z</dc:date>
    <item>
      <title>Measure using IF column and AND measure =</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-using-IF-column-and-AND-measure/m-p/3147112#M112613</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;New to the world of DAX after years of using Microstrategy and Qlik.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm struggling to get my head around a few calculations/statements. Would someone be able to assist with my current issue:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if("MARKET" = 'CN' and "Value" &amp;lt; 0.001, 0,&lt;BR /&gt;if("MARKET" = 'JP' and "Value" &amp;lt; 0.001,0,&lt;BR /&gt;"Tot_gross")) as "Gross"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Market, Value and Tot_gross are all in the same table. When i try to calculate a new measure using the IF statement it doesn't let me select the neccessry column (in this case 'Market')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am i doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 12:15:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-using-IF-column-and-AND-measure/m-p/3147112#M112613</guid>
      <dc:creator>jrdwthomas</dc:creator>
      <dc:date>2023-03-22T12:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Measure using IF column and AND measure =</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-using-IF-column-and-AND-measure/m-p/3147118#M112614</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="534188" data-lia-user-login="jrdwthomas" class="lia-mention lia-mention-user"&gt;jrdwthomas&lt;/a&gt;&amp;nbsp;Try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
  VAR __Market = MAX('Table'[Market])
  VAR __Value = MAX('Table'[Value])
  VAR __TotGross = MAX('Table'[Tot_gross])
  VAR __Result = 
    SWITCH(TRUE(),
      __Market = "CN" &amp;amp;&amp;amp; [Value] &amp;lt; 0.001,0,
      __Market = "JP" &amp;amp;&amp;amp; [Value] &amp;lt; 0.001,0,
     [Tot_gross]
    )
RETURN
  __Result&lt;/LI-CODE&gt;
&lt;P&gt;When you have a measure, you have to wrap column references in an aggregator. Check out my YouTube channel, DAX For Humans. It is specifically geared toward teaching people that are new to DAX the fundamentals.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.youtube.com/playlist?list=PL-pfHAlWLrbTXJrmu9bpD2rSzzGxf5gWY" target="_blank"&gt;DAX For Humans - YouTube&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 12:19:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-using-IF-column-and-AND-measure/m-p/3147118#M112614</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-03-22T12:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Measure using IF column and AND measure =</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-using-IF-column-and-AND-measure/m-p/3147198#M112622</link>
      <description>&lt;P&gt;Well that resultant syntax didn't look anything like what i expected. Seems i've got a lot of learning to do. The only thing i changed was the&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MAX('Table'[Tot_gross]) to instead use SUM('Table'[Tot_gross])&lt;/LI-CODE&gt;&lt;P&gt;That seems to now give me the output needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your quick assistance. Much appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 12:57:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-using-IF-column-and-AND-measure/m-p/3147198#M112622</guid>
      <dc:creator>jrdwthomas</dc:creator>
      <dc:date>2023-03-22T12:57:25Z</dc:date>
    </item>
  </channel>
</rss>

