<?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: Row count not counting rows on last day of the month in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-count-not-counting-rows-on-last-day-of-the-month/m-p/1287322#M22069</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="62520" data-lia-user-login="Rince91" class="lia-mention lia-mention-user"&gt;Rince91&lt;/a&gt; , Do you have a timestamp in date. in that case, you need at timestamp in end date &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;VAR EndDate = EOMONTH(TODAY(),-1) +time(23,59,59)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or create date column without timestamp&lt;/P&gt;
&lt;P&gt;Date = [CLOSE_TIME_Month_Year].date&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and us time intelligence&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
last MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
last year MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))
last year MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer : &lt;BR /&gt;&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions&lt;/A&gt; &lt;BR /&gt;&lt;A href="https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi" target="_blank"&gt;https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;See if my webinar on Time Intelligence can help: &lt;A href="https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184" target="_blank"&gt;https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Appreciate your Kudos.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Aug 2020 11:45:11 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2020-08-11T11:45:11Z</dc:date>
    <item>
      <title>Row count not counting rows on last day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-count-not-counting-rows-on-last-day-of-the-month/m-p/1287301#M22067</link>
      <description>&lt;P&gt;Im using the below measure to count the number of rows in the last month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However for some reason it is missing some rows that occur on the 31st July.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cant figure this one out as to why. Any thoughts?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MoM Growth = 

VAR StartDate = EOMONTH(TODAY(),-2)+1
VAR EndDate = EOMONTH(TODAY(),-1)

RETURN
CALCULATE(
DISTINCTCOUNT(ServiceReview[Interaction Ref]),
Filter(
ADDCOLUMNS(
ServiceReview,
"Last Month", IF(ServiceReview[CLOSE_TIME_Month_Year] &amp;gt;= StartDate
&amp;amp;&amp;amp; ServiceReview[CLOSE_TIME_Month_Year] &amp;lt;= EndDate, "Yes", "No")),[Last Month] = "Yes"))+0&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 11 Aug 2020 11:32:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-count-not-counting-rows-on-last-day-of-the-month/m-p/1287301#M22067</guid>
      <dc:creator>Rince91</dc:creator>
      <dc:date>2020-08-11T11:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: Row count not counting rows on last day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-count-not-counting-rows-on-last-day-of-the-month/m-p/1287322#M22069</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="62520" data-lia-user-login="Rince91" class="lia-mention lia-mention-user"&gt;Rince91&lt;/a&gt; , Do you have a timestamp in date. in that case, you need at timestamp in end date &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;VAR EndDate = EOMONTH(TODAY(),-1) +time(23,59,59)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or create date column without timestamp&lt;/P&gt;
&lt;P&gt;Date = [CLOSE_TIME_Month_Year].date&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and us time intelligence&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
last MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
last year MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))
last year MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer : &lt;BR /&gt;&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions&lt;/A&gt; &lt;BR /&gt;&lt;A href="https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi" target="_blank"&gt;https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;See if my webinar on Time Intelligence can help: &lt;A href="https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184" target="_blank"&gt;https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Appreciate your Kudos.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 11:45:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-count-not-counting-rows-on-last-day-of-the-month/m-p/1287322#M22069</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-08-11T11:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Row count not counting rows on last day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-count-not-counting-rows-on-last-day-of-the-month/m-p/1287324#M22070</link>
      <description>Maybe you need to use ALL ( ServiceReview )</description>
      <pubDate>Tue, 11 Aug 2020 11:47:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-count-not-counting-rows-on-last-day-of-the-month/m-p/1287324#M22070</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-08-11T11:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Row count not counting rows on last day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-count-not-counting-rows-on-last-day-of-the-month/m-p/1288260#M22109</link>
      <description>&lt;P&gt;This is great thanks. Unfortunately it didnt fix the issue...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've done what you suggested created a&amp;nbsp;&lt;SPAN&gt;Date = [CLOSE_TIME_Month_Year].date column.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Followed your webinar and created a date table and set up the relation ship.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However ther error persists. It is still missing one particular row on the 31st of july.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is the row that is missing, there are other rows for other customers, but this is one i know for sure isnt showing up correctly in the counts/visuals.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a column with the unique 5 digit customer number. I then have a column with a unique ticket refference, i have then created a closed ticket time column as you suggested.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The report is supposed to filter to a specific customer number then count the unique ticket references that occured last month.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I think there may be something wrong with the data itself as i can see the row in the raw data table, but it wont show in any visuals or measures. The date column is generating correctly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 17:00:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-count-not-counting-rows-on-last-day-of-the-month/m-p/1288260#M22109</guid>
      <dc:creator>Rince91</dc:creator>
      <dc:date>2020-08-11T17:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Row count not counting rows on last day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-count-not-counting-rows-on-last-day-of-the-month/m-p/1290465#M22156</link>
      <description>&lt;LI-CODE lang="csharp"&gt;MoM Growth =
VAR StartDateInclusive =
    EOMONTH(
        TODAY(),
        -2
    ) + 1
VAR EndDateExclusive =
    EOMONTH(
        TODAY(),
        -1
    ) + 1
RETURN
    CALCULATE(
        DISTINCTCOUNT( ServiceReview[Interaction Ref] ) + 0,
        KEEPFILTERS( StartDateInclusive &amp;lt;= ServiceReview[CLOSE_TIME_Month_Year] ),
        KEEPFILTERS(  ServiceReview[CLOSE_TIME_Month_Year] &amp;lt; EndDateExclusive )
    )&lt;/LI-CODE&gt;&lt;P&gt;What about this?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 12:34:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-count-not-counting-rows-on-last-day-of-the-month/m-p/1290465#M22156</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-12T12:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Row count not counting rows on last day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-count-not-counting-rows-on-last-day-of-the-month/m-p/1300236#M22499</link>
      <description>&lt;P&gt;So i solved the issue.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;There was an issue with how the customer number was filtering. Some instances of the number were appearing as text wheras others were formatted as a number.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Fixed that formatting then implemented the time intelligence that &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;suggested and it works great!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 08:43:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-count-not-counting-rows-on-last-day-of-the-month/m-p/1300236#M22499</guid>
      <dc:creator>Rince91</dc:creator>
      <dc:date>2020-08-17T08:43:50Z</dc:date>
    </item>
  </channel>
</rss>

