<?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: Checking if a record has been submitted consistently in the past 3 months in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Checking-if-a-record-has-been-submitted-consistently-in-the-past/m-p/2961442#M98652</link>
    <description>&lt;P&gt;Hi ,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi ,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your drscription, you want to "&lt;SPAN&gt;plot the trend by month looking at the number of 3 consecutive records&amp;nbsp; for each month&lt;/SPAN&gt;". Do you mean you want to get the count of the&amp;nbsp;&lt;SPAN&gt;3 consecutive records by the Year_month dimensiuon? right?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here are the steps you can refer to :&lt;BR /&gt;(1)This is my test data:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2)We can create a calendar table like this and we do not need to create relationship between tables:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table = CALENDAR(FIRSTDATE('Record'[Date]), LASTDATE('Record'[Date]))
&lt;/LI-CODE&gt;
&lt;P&gt;(3)Then we can create a measure :&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure 2 = var _t = SUMMARIZE( ALLSELECTED( 'Record') , [Year_month] , [Record] )
var _cur_date = MAX('Table'[Date])
var _last_3_month = EOMONTH( _cur_date , -3)+1
var _t2 = FILTER(_t , [Year_month] &amp;gt;= YEAR(_last_3_month)*100+MONTH(_last_3_month) &amp;amp;&amp;amp; [Year_month] &amp;lt;= YEAR(_cur_date)*100+MONTH(_cur_date))
var _t3 = ADDCOLUMNS(_t2 , "count" ,var _record = [Record] return COUNTROWS( FILTER(_t2,[Record]=_record)))
return
COUNTROWS(DISTINCT( SELECTCOLUMNS(  FILTER(_t3,[count]=3),"record",[Record]))  )
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;The result is as follows:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;</description>
    <pubDate>Mon, 12 Dec 2022 05:31:05 GMT</pubDate>
    <dc:creator>v-yueyunzh-msft</dc:creator>
    <dc:date>2022-12-12T05:31:05Z</dc:date>
    <item>
      <title>Checking if a record has been submitted consistently in the past 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Checking-if-a-record-has-been-submitted-consistently-in-the-past/m-p/2953476#M98016</link>
      <description>&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;I have a table that has records coming from stores with a date field, I would like to know how to check if a store has consistenly submitted a record for each of the past 3 months.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone done something like this?&amp;nbsp; Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 09:03:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Checking-if-a-record-has-been-submitted-consistently-in-the-past/m-p/2953476#M98016</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-07T09:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Checking if a record has been submitted consistently in the past 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Checking-if-a-record-has-been-submitted-consistently-in-the-past/m-p/2955317#M98164</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, you want to check the&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;record has been submitted consistently in the past 3 months. Right?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here are the steps you can refer to :&lt;BR /&gt;(1)This is my test data: in my data, the "record1,record4" meet the need.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;In my logic , i get the max date of each record , and get the past three months.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2)We need to create a calcualted column in the Table:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Year_month = Year([Date])*100+MONTH([Date])&lt;/LI-CODE&gt;
&lt;P&gt;(3)Then we can create a measure like this :&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = var _max_year_month = MAX('Record'[Year_month])
var _past_3year_month= YEAR(EOMONTH( MAX('Record'[Date]) ,-3)+1)*100+MONTH(EOMONTH( MAX('Record'[Date]) ,-3)+1)
var _t =DISTINCT(SELECTCOLUMNS( FILTER('Record' , 'Record'[Year_month] &amp;lt;= _max_year_month &amp;amp;&amp;amp; 'Record'[Year_month]&amp;gt;= _past_3year_month) , "year_month" , [Year_month]))
return
IF(COUNTROWS(_t)=3,1,0)&lt;/LI-CODE&gt;
&lt;P&gt;(4)Then we can meet your need, the result is as follows:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If this method does not meet your needs, you can provide us with your special &lt;STRONG&gt;sample data&lt;/STRONG&gt; and the &lt;STRONG&gt;desired output sample&lt;/STRONG&gt; data in the form of &lt;STRONG&gt;tables&lt;/STRONG&gt;, so that we can better help you solve the problem.&lt;/P&gt;
&lt;P&gt;Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 02:05:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Checking-if-a-record-has-been-submitted-consistently-in-the-past/m-p/2955317#M98164</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2022-12-08T02:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Checking if a record has been submitted consistently in the past 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Checking-if-a-record-has-been-submitted-consistently-in-the-past/m-p/2958945#M98427</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="433015" data-lia-user-login="v-yueyunzh-msft" class="lia-mention lia-mention-user"&gt;v-yueyunzh-msft&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your help, this does give you the total of 3 consecutive records, the data structure is basically the same however each store can have multiple entries on the same day for different products. I would like to also plot the trend by month looking at the number of 3 consecutive records&amp;nbsp; for each month. I hope you can still help on this so I'll accept you initial response because it does get you the total number.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 11:59:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Checking-if-a-record-has-been-submitted-consistently-in-the-past/m-p/2958945#M98427</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-09T11:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Checking if a record has been submitted consistently in the past 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Checking-if-a-record-has-been-submitted-consistently-in-the-past/m-p/2961442#M98652</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi ,&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your drscription, you want to "&lt;SPAN&gt;plot the trend by month looking at the number of 3 consecutive records&amp;nbsp; for each month&lt;/SPAN&gt;". Do you mean you want to get the count of the&amp;nbsp;&lt;SPAN&gt;3 consecutive records by the Year_month dimensiuon? right?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here are the steps you can refer to :&lt;BR /&gt;(1)This is my test data:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2)We can create a calendar table like this and we do not need to create relationship between tables:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table = CALENDAR(FIRSTDATE('Record'[Date]), LASTDATE('Record'[Date]))
&lt;/LI-CODE&gt;
&lt;P&gt;(3)Then we can create a measure :&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure 2 = var _t = SUMMARIZE( ALLSELECTED( 'Record') , [Year_month] , [Record] )
var _cur_date = MAX('Table'[Date])
var _last_3_month = EOMONTH( _cur_date , -3)+1
var _t2 = FILTER(_t , [Year_month] &amp;gt;= YEAR(_last_3_month)*100+MONTH(_last_3_month) &amp;amp;&amp;amp; [Year_month] &amp;lt;= YEAR(_cur_date)*100+MONTH(_cur_date))
var _t3 = ADDCOLUMNS(_t2 , "count" ,var _record = [Record] return COUNTROWS( FILTER(_t2,[Record]=_record)))
return
COUNTROWS(DISTINCT( SELECTCOLUMNS(  FILTER(_t3,[count]=3),"record",[Record]))  )
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;The result is as follows:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 05:31:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Checking-if-a-record-has-been-submitted-consistently-in-the-past/m-p/2961442#M98652</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2022-12-12T05:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Checking if a record has been submitted consistently in the past 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Checking-if-a-record-has-been-submitted-consistently-in-the-past/m-p/2962965#M98772</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="433015" data-lia-user-login="v-yueyunzh-msft" class="lia-mention lia-mention-user"&gt;v-yueyunzh-msft&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for you response, this is really close.Yes I would like to the get the count of 3 consecutive reports by the&amp;nbsp; Year_month dimension. I prefer to have this in a calculated table than using a measure. Can you help?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 15:46:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Checking-if-a-record-has-been-submitted-consistently-in-the-past/m-p/2962965#M98772</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-12T15:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Checking if a record has been submitted consistently in the past 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Checking-if-a-record-has-been-submitted-consistently-in-the-past/m-p/2963976#M98841</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to get as a calcualted table , you can add a column in 'Table':&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table = ADDCOLUMNS( CALENDAR(FIRSTDATE('Record'[Date]), LASTDATE('Record'[Date])) , "Year_month" , FORMAT([Date] , "yyyy-mm"))
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then you can click "New Table" and enter this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Result Table = SUMMARIZE('Table' , [Year_month] , "count",[Measure 2])&lt;/LI-CODE&gt;
&lt;P&gt;Then we can get the result as a calculated table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 03:20:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Checking-if-a-record-has-been-submitted-consistently-in-the-past/m-p/2963976#M98841</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2022-12-13T03:20:34Z</dc:date>
    </item>
  </channel>
</rss>

