<?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: How to calculate SUM IF in this particular case? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-SUM-IF-in-this-particular-case/m-p/1248187#M20503</link>
    <description>&lt;P&gt;Hi Harsh,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This I get on aggregation of above table&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date 1&lt;/TD&gt;&lt;TD&gt;If same&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Jul&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2-Jul&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want this&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date 1&lt;/TD&gt;&lt;TD&gt;New measure&lt;/TD&gt;&lt;TD&gt;perc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Jul&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;100%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2-Jul&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;100%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Total&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;100%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For ex: I tried using New measure = If([If same]&amp;gt;0,1,0), but then I can not SUM - because the total also says 1. And then I don't know how to calculate % of rows in this new table that it is 1 or 0. It would give me 100% or 0% in each row and then aggreated percentage in total.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Full story:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Date 1 - Normal calendar date&lt;/P&gt;&lt;P&gt;Date 2 - Employee logging in the time sheet data&lt;/P&gt;&lt;P&gt;KPI: We want to check on how many times, employee is logging on the same day.&lt;/P&gt;&lt;P&gt;Now, the 8 hours per day are also not logged at once. They can be divided and logged against type of work and even over days. So, maybe on 2nd July someone books 2 hours for travel and 6 hours for work for the work that was done on 1st of July. In this case, the hours are not booked on same day so synchronization against Date 1 for 1st July should be 0%.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I tried with countrows+filter and if statement&amp;nbsp; - in the last 2 rows. The problem is it is giving me total of number of rows because the hours booked are broken up against different areas (travel, work etc). So, basically, these 5,5, 4, 10 all means 1 to me and 0 means 0. How to achieve this? Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jul 2020 11:26:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-07-24T11:26:54Z</dc:date>
    <item>
      <title>How to calculate SUM IF in this particular case?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-SUM-IF-in-this-particular-case/m-p/1248004#M20498</link>
      <description>&lt;P&gt;My data has 2 dates. I have to count how many times they are same BUT not per row but per date1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I can create a column with simple if statement, or countrows and check "if same". Problem is aggregation. Now on aggregation by date 1 - for 1-jul, 2-jul it will give me 2 and 3. Instead, I am now looking for a calculation measure/column that treats 2 and 3 as 1 count only and then I have to take percentage of total.&lt;/P&gt;&lt;P&gt;What approach should I take?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, I have to count &lt;STRONG&gt;percentage of times the dates are same&lt;/STRONG&gt;, ignoring the fact if their are more rows per value of date1. (because in actual data I have more columns and there would be more repetition).&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date 1&lt;/TD&gt;&lt;TD&gt;Date 2&lt;/TD&gt;&lt;TD&gt;If same&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Jul&lt;/TD&gt;&lt;TD&gt;1-Jul&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Jul&lt;/TD&gt;&lt;TD&gt;30-Jun&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Jul&lt;/TD&gt;&lt;TD&gt;1-Jul&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2-Jul&lt;/TD&gt;&lt;TD&gt;2-Jul&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2-Jul&lt;/TD&gt;&lt;TD&gt;1-Jul&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2-Jul&lt;/TD&gt;&lt;TD&gt;2-Jul&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2-Jul&lt;/TD&gt;&lt;TD&gt;2-Jul&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 24 Jul 2020 10:21:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-SUM-IF-in-this-particular-case/m-p/1248004#M20498</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-24T10:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate SUM IF in this particular case?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-SUM-IF-in-this-particular-case/m-p/1248050#M20500</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not very clear as to what is the expected output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Share more data and the expected output to help you on this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;HN&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 10:41:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-SUM-IF-in-this-particular-case/m-p/1248050#M20500</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-24T10:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate SUM IF in this particular case?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-SUM-IF-in-this-particular-case/m-p/1248150#M20502</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Try this formula:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Total Same Days = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var filterSameDays = FILTER('Table','Table'[Same Date]&amp;gt;0)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var CountSameDays = COUNTROWS(filterSameDays)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;IF(CountSameDays&amp;gt;0,1,0)&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Cheers,&lt;BR /&gt;Nemanja&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 24 Jul 2020 11:17:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-SUM-IF-in-this-particular-case/m-p/1248150#M20502</guid>
      <dc:creator>nandic</dc:creator>
      <dc:date>2020-07-24T11:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate SUM IF in this particular case?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-SUM-IF-in-this-particular-case/m-p/1248187#M20503</link>
      <description>&lt;P&gt;Hi Harsh,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This I get on aggregation of above table&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date 1&lt;/TD&gt;&lt;TD&gt;If same&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Jul&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2-Jul&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want this&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date 1&lt;/TD&gt;&lt;TD&gt;New measure&lt;/TD&gt;&lt;TD&gt;perc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Jul&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;100%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2-Jul&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;100%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Total&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;100%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For ex: I tried using New measure = If([If same]&amp;gt;0,1,0), but then I can not SUM - because the total also says 1. And then I don't know how to calculate % of rows in this new table that it is 1 or 0. It would give me 100% or 0% in each row and then aggreated percentage in total.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Full story:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Date 1 - Normal calendar date&lt;/P&gt;&lt;P&gt;Date 2 - Employee logging in the time sheet data&lt;/P&gt;&lt;P&gt;KPI: We want to check on how many times, employee is logging on the same day.&lt;/P&gt;&lt;P&gt;Now, the 8 hours per day are also not logged at once. They can be divided and logged against type of work and even over days. So, maybe on 2nd July someone books 2 hours for travel and 6 hours for work for the work that was done on 1st of July. In this case, the hours are not booked on same day so synchronization against Date 1 for 1st July should be 0%.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I tried with countrows+filter and if statement&amp;nbsp; - in the last 2 rows. The problem is it is giving me total of number of rows because the hours booked are broken up against different areas (travel, work etc). So, basically, these 5,5, 4, 10 all means 1 to me and 0 means 0. How to achieve this? Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 11:26:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-SUM-IF-in-this-particular-case/m-p/1248187#M20503</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-24T11:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate SUM IF in this particular case?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-SUM-IF-in-this-particular-case/m-p/1248193#M20504</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is Total = 1.&amp;nbsp; I want to count how many times it is 1.&amp;nbsp; That is the whole point of having these 1s.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 11:28:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-SUM-IF-in-this-particular-case/m-p/1248193#M20504</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-24T11:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate SUM IF in this particular case?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-SUM-IF-in-this-particular-case/m-p/1248227#M20505</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Try this option:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Total Same Days 2 = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var filterSameDays = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ADDCOLUMNS(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; SUMMARIZE(FILTER('Table','Table'[Same Date]&amp;gt;0),'Table'[Date 1]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; "If Same Day",IF(COUNTROWS('Table')&amp;gt;0,1,0)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var CountSameDays = COUNTROWS(filterSameDays)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var Counter = IF(CountSameDays&amp;gt;0,1,0)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(HASONEVALUE('Table'[Date 1]),Counter,SUMX(filterSameDays,[If Same Day]))&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Nemanja&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 24 Jul 2020 11:42:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-SUM-IF-in-this-particular-case/m-p/1248227#M20505</guid>
      <dc:creator>nandic</dc:creator>
      <dc:date>2020-07-24T11:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate SUM IF in this particular case?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-SUM-IF-in-this-particular-case/m-p/1248278#M20511</link>
      <description>&lt;P&gt;Hi Nemanja,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, it seems to be working now.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please check my Message 4 above. I want this information to be broken up by WORKCENTER (per employee)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What changes do I have to make in the code?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 12:02:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-SUM-IF-in-this-particular-case/m-p/1248278#M20511</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-24T12:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate SUM IF in this particular case?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-SUM-IF-in-this-particular-case/m-p/1248304#M20515</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;BR /&gt;Currently it summarizes values by column "Date 1".&lt;BR /&gt;First variable "FilterSameDays" has that part : Summarize(filter([table], value, [column1],[column2],[column3]).&lt;/P&gt;&lt;P&gt;At the moment, column 1 is "Date 1", under column2 and column 3 you can set other columns by which you would like also to group data.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 12:12:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-SUM-IF-in-this-particular-case/m-p/1248304#M20515</guid>
      <dc:creator>nandic</dc:creator>
      <dc:date>2020-07-24T12:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate SUM IF in this particular case?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-SUM-IF-in-this-particular-case/m-p/1248313#M20518</link>
      <description>&lt;P&gt;Thanks for explaining. I will explore more on SUMMARIZE DAX. Seems very useful.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 12:17:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-SUM-IF-in-this-particular-case/m-p/1248313#M20518</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-24T12:17:49Z</dc:date>
    </item>
  </channel>
</rss>

