<?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: Date issues on a custom date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-issues-on-a-custom-date/m-p/1723219#M35652</link>
    <description>&lt;P&gt;even with this value, now it work in a card but my M-1 column is still empty.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EOMONTH(ALLSELECTED(Customers[Generic_Period]),-1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Mar 2021 17:36:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-03-15T17:36:37Z</dc:date>
    <item>
      <title>Date issues on a custom date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-issues-on-a-custom-date/m-p/1721866#M35622</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have issues to associate dates correctly. I don't really know how to workaround this.&lt;BR /&gt;Note: the second table is a view and i can modify it for my needs.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have dimension date table as follow:&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;I have an other table with products and dates like this (i show you only dates here):&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;I made a relation between them:&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;I want to count customer by entity for a specific report period, so i made a segment on the Generic_Period.&lt;BR /&gt;I created mesures for this segment:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Customers = 
CALCULATE(DISTINCTCOUNT('Customers'[Customer]), 
filter(Customers, Customers[Generic_Period] = DATEADD(Customers[Generic_Period],0,MONTH)))

Customers M-1 = 
CALCULATE(DISTINCTCOUNT('Customers'[Customer]), 
filter(Customers, Customers[Generic_Period] = DATEADD(Customers[Generic_Period],-1,MONTH)))&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;The first probleme is Q-1 returns 0 values :&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;The second problem, It doesn't work if the day number isn't the same as previous month.&lt;BR /&gt;If i select 30/09/2019 it will not retrieve the&amp;nbsp;31/10/2019 even with end of month -1 like this :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ENDOFMONTH(DATEADD(Subscription_Partner_by_month[Generic_Period],-1,MONTH))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 08:27:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-issues-on-a-custom-date/m-p/1721866#M35622</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-15T08:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Date issues on a custom date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-issues-on-a-custom-date/m-p/1722939#M35643</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , the requirement is not very clear. &lt;/P&gt;
&lt;P&gt;dateadd should be used on the date table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))&lt;BR /&gt;Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))&lt;/P&gt;
&lt;P&gt;Last QUARTER Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD( ENDOFQUARTER(dateadd('Date'[Date],-1,QUARTER))))&lt;BR /&gt;Last QUARTER Sales = CALCULATE(SUM(Sales[Sales Amount]),PREVIOUSQUARTER(('Date'[Date])))&lt;/P&gt;
&lt;P&gt;Last to last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-2,QUARTER)))&lt;BR /&gt;Next QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],1,QUARTER)))&lt;BR /&gt;Last year same QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,Year)))&lt;BR /&gt;Last year same QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(ENDOFQUARTER(dateadd('Date'[Date],-1,Year))))&lt;BR /&gt;trailing QTR = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,QUARTER))&lt;BR /&gt;trailing 4 QTR = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-4,QUARTER))&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 15:05:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-issues-on-a-custom-date/m-p/1722939#M35643</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-03-15T15:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Date issues on a custom date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-issues-on-a-custom-date/m-p/1723064#M35645</link>
      <description>&lt;P&gt;Hello &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; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you reply me each time and i thank you for that but &lt;STRONG&gt;CALCULATE(SUM&lt;/STRONG&gt; doesn,'t work in my case as my field is a string !&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have a date column in my &lt;STRONG&gt;data table&lt;/STRONG&gt; wich i want to link with my &lt;STRONG&gt;date table.&lt;BR /&gt;&lt;/STRONG&gt;I want to retrieve all the data wich corresponding to the generic_period colum.&lt;STRONG&gt; I would have the same for Month-1, Month-2 etc ...&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;For exemple: if i choose in my report segment period 30/09/2019, i would also retrieve data from the previous report period (31/08/2019), but it is blank in my result table.&lt;BR /&gt;&lt;BR /&gt;This seems not work ? i am doing something wrong here ? How could i handle it ?&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;&lt;LI-CODE lang="markup"&gt;test Q-1 = 
CALCULATE(DISTINCTCOUNT('Customers'[Customer]),
filter('Date', ENDOFMONTH(DATEADD('Date'[Date],-1,MONTH)) IN (ALLSELECTED(Customers[Generic_Period])))
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My date table is generated like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Date = CALENDAR(DATE(2018,1,1),DATE(2030,12,31))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 06:18:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-issues-on-a-custom-date/m-p/1723064#M35645</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-16T06:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Date issues on a custom date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-issues-on-a-custom-date/m-p/1723219#M35652</link>
      <description>&lt;P&gt;even with this value, now it work in a card but my M-1 column is still empty.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EOMONTH(ALLSELECTED(Customers[Generic_Period]),-1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 17:36:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-issues-on-a-custom-date/m-p/1723219#M35652</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-15T17:36:37Z</dc:date>
    </item>
  </channel>
</rss>

