<?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: Report for week and 2 week ago in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Report-for-week-and-2-week-ago/m-p/3196023#M116031</link>
    <description>&lt;P&gt;Also i made new column in Date table:&lt;BR /&gt;Date- 14 which is Date - 14 days.&lt;BR /&gt;Week - 2 which is Weeknum(Date-14, 21)&lt;BR /&gt;I made new columns in Task &amp;nbsp;- WeekISO=realted(Date Week ISO) and WeekISO-2 =Realated(Date WeekISO)&lt;/P&gt;&lt;P&gt;And tried&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;CALCULATE(&lt;BR /&gt;DISTINCTCOUNT(Task[DocumentNo]),&lt;BR /&gt;FILTER(&lt;BR /&gt;Task,&lt;BR /&gt;Task[Week ISO]= SELECTEDVALUE(&lt;BR /&gt;'Date'[Week_ISO -2]&lt;BR /&gt;but it doesnt return result.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Apr 2023 14:15:37 GMT</pubDate>
    <dc:creator>ivaylodemirev</dc:creator>
    <dc:date>2023-04-19T14:15:37Z</dc:date>
    <item>
      <title>Report for week and 2 week ago</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Report-for-week-and-2-week-ago/m-p/3196004#M116027</link>
      <description>&lt;P&gt;I have date table Date whith columns Date, Week_ISO.&lt;BR /&gt;For Week_ISO i have formula WEEKNUM([Date],21).&lt;BR /&gt;There is a another table Tasks where I have column DocumentNo and TaskDate.&lt;BR /&gt;This two tables are related by Date and TaskDate.&lt;/P&gt;&lt;P&gt;I have to make report for Number of document per chosen week and Number of documents per chosen Week -2.&lt;BR /&gt;Report must have fitler by Week_ISO from Column Date.&lt;BR /&gt;I want to make measures:&lt;BR /&gt;1. Sites per Week - which counted distinct DocumentNo were Week for TaskDate = selected values for filter WEEK_ISO from Date.&lt;BR /&gt;2. Sites for 2 Week Ago - which counted distinct DocumentNo where Week for TaskDate = selected values for filter with WEEK_ISO- 2 weeks.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 14:08:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Report-for-week-and-2-week-ago/m-p/3196004#M116027</guid>
      <dc:creator>ivaylodemirev</dc:creator>
      <dc:date>2023-04-19T14:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Report for week and 2 week ago</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Report-for-week-and-2-week-ago/m-p/3196005#M116028</link>
      <description>&lt;P&gt;I tried&amp;nbsp;&lt;BR /&gt;Sites per Week =&lt;BR /&gt;DISTINCTCOUNT(Tasks[DocumentNo])&lt;BR /&gt;&lt;BR /&gt;Sites for 2 Week Ago =&lt;BR /&gt;VAR SelectedWeek = SELECTEDVALUE('Date'[Week_ISO])&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE(&lt;BR /&gt;DISTINCTCOUNT(Tasks[DocumentNo]),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL('Date'),&lt;BR /&gt;'Date'[Week_ISO] = SelectedWeek - 2&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;but second measure return me blank&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 14:08:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Report-for-week-and-2-week-ago/m-p/3196005#M116028</guid>
      <dc:creator>ivaylodemirev</dc:creator>
      <dc:date>2023-04-19T14:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Report for week and 2 week ago</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Report-for-week-and-2-week-ago/m-p/3196023#M116031</link>
      <description>&lt;P&gt;Also i made new column in Date table:&lt;BR /&gt;Date- 14 which is Date - 14 days.&lt;BR /&gt;Week - 2 which is Weeknum(Date-14, 21)&lt;BR /&gt;I made new columns in Task &amp;nbsp;- WeekISO=realted(Date Week ISO) and WeekISO-2 =Realated(Date WeekISO)&lt;/P&gt;&lt;P&gt;And tried&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;CALCULATE(&lt;BR /&gt;DISTINCTCOUNT(Task[DocumentNo]),&lt;BR /&gt;FILTER(&lt;BR /&gt;Task,&lt;BR /&gt;Task[Week ISO]= SELECTEDVALUE(&lt;BR /&gt;'Date'[Week_ISO -2]&lt;BR /&gt;but it doesnt return result.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 14:15:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Report-for-week-and-2-week-ago/m-p/3196023#M116031</guid>
      <dc:creator>ivaylodemirev</dc:creator>
      <dc:date>2023-04-19T14:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Report for week and 2 week ago</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Report-for-week-and-2-week-ago/m-p/3199482#M116240</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="548518" data-lia-user-login="ivaylodemirev" class="lia-mention lia-mention-user"&gt;ivaylodemirev&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, here are my steps you can follow as a solution.&lt;/P&gt;
&lt;P&gt;(1) This is my test data.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Date = ADDCOLUMNS(CALENDAR(DATE(2022,1,1),DATE(2022,12,31)) ,
"Week_ISO",WEEKNUM([Date],21))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2) We can create two measures.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sites per Week = 
var _select=SELECTEDVALUE('Date'[Week_ISO])

return
COUNTROWS(FILTER(ALL('Task'),WEEKNUM('Task'[TaskDate],21)=_select))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Sites for 2 Week Ago = 

var _select=SELECTEDVALUE('Date'[Week_ISO])

return
COUNTROWS(FILTER(ALL('Task'),WEEKNUM('Task'[TaskDate],21)+2=_select))&lt;/LI-CODE&gt;
&lt;P&gt;(3) Then the result is as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the above one can't help you get the desired result, please provide some&amp;nbsp;&lt;STRONG&gt;sample data&lt;/STRONG&gt;&amp;nbsp;in your tables (&lt;STRONG&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/STRONG&gt;) with&amp;nbsp;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;format and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&amp;nbsp;with backend logic and special examples.&amp;nbsp;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;pbix file.&amp;nbsp;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 07:09:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Report-for-week-and-2-week-ago/m-p/3199482#M116240</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-21T07:09:30Z</dc:date>
    </item>
  </channel>
</rss>

