<?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 &amp;amp; Substraction formulas showing totals wrong in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-amp-Substraction-formulas-showing-totals-wrong/m-p/784360#M4237</link>
    <description>&lt;P&gt;It works&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="88633" data-lia-user-login="sturlaws" class="lia-mention lia-mention-user"&gt;sturlaws&lt;/a&gt;&amp;nbsp;!!! Thank you very much !!! :D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Sep 2019 07:49:25 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-09-05T07:49:25Z</dc:date>
    <item>
      <title>IF &amp; Substraction formulas showing totals wrong</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-amp-Substraction-formulas-showing-totals-wrong/m-p/781474#M4138</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I might be doing something wrong with my formulas as it calculates the totals as it shouldn't.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The table looks like this when I add the candidate's ID to see where the issues are (that means that each row is a different candidate):&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The formula for the column in the middle is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;From Interview Scheduled to Offer =&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;IF ( ISBLANK([_Average days to Offer]) || ISBLANK([_Average days to Interview - Scheduled]), BLANK(),([_Average days to Offer] - [_Average days to Interview - Scheduled]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The 1st and last column have these formulas which apply to Whole number columns (that have a different number of days in it or null rows):&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;_Average days to Interview - Scheduled&lt;/SPAN&gt; =&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE( AVERAGE([_Days Application to Interview - Scheduled]), FILTER(report, report[_Days Application to Interview - Scheduled] &amp;lt;&amp;gt; 0 ))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;_Average days to Offer&lt;/SPAN&gt; = CALCULATE( AVERAGE([_Days Application to Offer]), FILTER(report, report[_Days Application to Offer] &amp;lt;&amp;gt; 0 ))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;The purpose of the calculations is to ignore all the results that are blank on the other side but in the Total, it doesn't ignore them. In this case, the TOTAL of&amp;nbsp;From Interview Scheduled to Offer should be BLANK() and not "-38"&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Is there anything I can do to fix this?&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you very much!&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 Sep 2019 14:42:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-amp-Substraction-formulas-showing-totals-wrong/m-p/781474#M4138</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-02T14:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: IF &amp; Substraction formulas showing totals wrong</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-amp-Substraction-formulas-showing-totals-wrong/m-p/783449#M4204</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;there might be something I don't understand, but in the total neither [_Average days to Interview - Scheduled] or [_Average days to Offer] is blank, so you get 38 - 76 = -38. Why should it be blank?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2019 10:47:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-amp-Substraction-formulas-showing-totals-wrong/m-p/783449#M4204</guid>
      <dc:creator>sturlaws</dc:creator>
      <dc:date>2019-09-04T10:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: IF &amp; Substraction formulas showing totals wrong</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-amp-Substraction-formulas-showing-totals-wrong/m-p/783645#M4214</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="88633" data-lia-user-login="sturlaws" class="lia-mention lia-mention-user"&gt;sturlaws&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for asking,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I was trying to do is to calculate the time between Interview Scheduled to Offer&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's why I might be wrong in calculating an average of the 2 separately and then subtract them. The only reason I did the average was to take out the 0's and have a measure available.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I wanted to achieve with the formula below is to have a sort of calculation per Candidate ID that if they didn't pass through Interview Scheduled and Offer, to not calculate a subtraction. And as you can see in the image I attached the column is blank. But the Total is still -38.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;From Interview Scheduled to Offer =&amp;nbsp;IF ( ISBLANK([_Average days to Offer]) || ISBLANK([_Average days to Interview - Scheduled]), BLANK(),([_Average days to Offer] - [_Average days to Interview - Scheduled]))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know how to tackle this. I'm out of ideas. What I know is that I have to add something to my formula to be based on each candidate ID.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope I made it more clear.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2019 14:06:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-amp-Substraction-formulas-showing-totals-wrong/m-p/783645#M4214</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-04T14:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: IF &amp; Substraction formulas showing totals wrong</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-amp-Substraction-formulas-showing-totals-wrong/m-p/783902#M4226</link>
      <description>&lt;P&gt;Have you looked at the AVERAGEX-function? It allows for a IF-statement inside the expression part, so you can do something like this&lt;/P&gt;&lt;PRE&gt;average =
AVERAGEX (
    'Table';
    IF (
        NOT ( ISBLANK ( [measure1] ) ) &amp;amp;&amp;amp; NOT ( ISBLANK ( [measure2] ) );
        [measure2] - [measure1];
        BLANK ()
    )
)&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2019 19:38:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-amp-Substraction-formulas-showing-totals-wrong/m-p/783902#M4226</guid>
      <dc:creator>sturlaws</dc:creator>
      <dc:date>2019-09-04T19:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: IF &amp; Substraction formulas showing totals wrong</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-amp-Substraction-formulas-showing-totals-wrong/m-p/784360#M4237</link>
      <description>&lt;P&gt;It works&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="88633" data-lia-user-login="sturlaws" class="lia-mention lia-mention-user"&gt;sturlaws&lt;/a&gt;&amp;nbsp;!!! Thank you very much !!! :D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 07:49:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-amp-Substraction-formulas-showing-totals-wrong/m-p/784360#M4237</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-05T07:49:25Z</dc:date>
    </item>
  </channel>
</rss>

