<?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: IF condition returns DAX error in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-condition-returns-DAX-error/m-p/817346#M5459</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;What do you mean you are not aggregating anything in a string field?&lt;/P&gt;&lt;P&gt;Nathaniel&lt;/P&gt;</description>
    <pubDate>Mon, 14 Oct 2019 14:18:46 GMT</pubDate>
    <dc:creator>Nathaniel_C</dc:creator>
    <dc:date>2019-10-14T14:18:46Z</dc:date>
    <item>
      <title>IF condition returns DAX error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-condition-returns-DAX-error/m-p/817325#M5457</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is a sample of the IF statements returning an error. The error is below. Also, I have tried using a Switch stmt and still get the error. Can anyone tell me what is wrong? When I use MAX it works but I am not aggregating anything in a string field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MeasureTop = IF('temp'[Category]= "Anes Timeout %", divide(SUM(temp[num]),SUM(temp[den])*.01) )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: A single value for column 'Category' in table 'temp' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 13:50:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-condition-returns-DAX-error/m-p/817325#M5457</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-14T13:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: IF condition returns DAX error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-condition-returns-DAX-error/m-p/817346#M5459</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;What do you mean you are not aggregating anything in a string field?&lt;/P&gt;&lt;P&gt;Nathaniel&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 14:18:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-condition-returns-DAX-error/m-p/817346#M5459</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2019-10-14T14:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: IF condition returns DAX error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-condition-returns-DAX-error/m-p/817353#M5462</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I think I see what you mean. When you write a formula in a calculated column the engine knows which row you are on. However when you write a measure, the engine does not know where you are applying the measure until you do. Therefore it will not accept the formula.&amp;nbsp; However if you add a max, it will know to which value to use in this formula, the (in this case) maximum value. Then it knows whether to return a true or false. Then when you apply this to for instance a matrix, it looks a the row filter and can apply it to that value or apply it to once again using the maximum when you are doing the total because there is no filter then.&amp;nbsp;&lt;BR /&gt;Let me know if you have any questions.&lt;BR /&gt;&lt;BR /&gt;If this solves your issues, please mark it as the &lt;STRONG&gt;solution, &lt;/STRONG&gt;so that others can find it easily. &lt;STRONG&gt;Kudos &lt;/STRONG&gt;are nice too.&lt;BR /&gt;Nathaniel&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 14:28:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-condition-returns-DAX-error/m-p/817353#M5462</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2019-10-14T14:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: IF condition returns DAX error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-condition-returns-DAX-error/m-p/817404#M5465</link>
      <description>&lt;P&gt;Thanks for your help. Let me be more clear on my request. I am looking for another way to write this in DAX where I do not have to use the MAX function or is MAX correct for this? This is a common query.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If my field value = XXXX then do this formula&lt;/P&gt;&lt;P&gt;if my field value = YYYY then do this formula&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It does not seem right having to use the MAX function but maybe it is???&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 15:06:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-condition-returns-DAX-error/m-p/817404#M5465</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-14T15:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: IF condition returns DAX error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-condition-returns-DAX-error/m-p/817422#M5467</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes MAX() is correct. You are asking the engine to make a decision based on your field value, yes? How does DAX "know" which row in that field is the one to use? Row 1? Row 2? etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Until you place it on a something that filters all the values down to one, you are trying to give it multiple values.&amp;nbsp; However when you place it on a matrix, there is only one value, the value from that row.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me recommend &lt;U&gt;Supercharge Power BI&lt;/U&gt; by&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="217" data-lia-user-login="MattAllington" class="lia-mention lia-mention-user"&gt;MattAllington&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Let me know if you have any questions.&lt;BR /&gt;&lt;BR /&gt;If this solves your issues, please mark it as the &lt;STRONG&gt;solution, &lt;/STRONG&gt;so that others can find it easily. &lt;STRONG&gt;Kudos &lt;/STRONG&gt;are nice too.&lt;BR /&gt;Nathaniel&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 15:24:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-condition-returns-DAX-error/m-p/817422#M5467</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2019-10-14T15:24:19Z</dc:date>
    </item>
  </channel>
</rss>

