<?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 Count the latest week of data available. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-latest-week-of-data-available/m-p/2642305#M77620</link>
    <description>&lt;P&gt;Hello DAXers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am in a situation where I cannot get my visual card to show the correct/latest week of data avaiable in my model.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To present my data in a visual card I am currently using the following DAX expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Latest week count =&lt;/P&gt;&lt;P&gt;VAR Count = MAX('Date'[WeekNbrYear])RETURN&lt;/P&gt;&lt;P&gt;CALCULATE(COUNT('Fact Table'[Entry_date]),('Date'[WeekNbrYear] = Count))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "('Fact Table'[Entry_date])" are dates customers have purchased from a store. The data type for this calculated column is set to Date: 14/03/01(d/mm/yy). I want to count each entry date and represent it in a visual card and for it to display only the latest week - be it a full 7 days (Monday to Sunday) or a couple of days (Mon to Tues).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have no problems displaying card counts for the last day or month available in my model - using the above DAX expression with appropriate modifications for day and month.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My week is from Monday to Sunday.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Time intelligence is on (I tried both on and off).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;'Date'[WeekNbrYear]&amp;nbsp;is a calculated column from my date table. Data type is text and ranges from Monday to Sunday:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WeekNbrYear = "W" &amp;amp; WEEKNUM ('Date'[Date],2) &amp;amp; " - " &amp;amp; YEAR ([Date])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below visual shows data for 2022 BUT the visual Card showing 1282 customers (W9-2022) instead of the latest being 356.&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jul 2022 23:57:37 GMT</pubDate>
    <dc:creator>matrix_user</dc:creator>
    <dc:date>2022-07-15T23:57:37Z</dc:date>
    <item>
      <title>Count the latest week of data available.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-latest-week-of-data-available/m-p/2642305#M77620</link>
      <description>&lt;P&gt;Hello DAXers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am in a situation where I cannot get my visual card to show the correct/latest week of data avaiable in my model.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To present my data in a visual card I am currently using the following DAX expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Latest week count =&lt;/P&gt;&lt;P&gt;VAR Count = MAX('Date'[WeekNbrYear])RETURN&lt;/P&gt;&lt;P&gt;CALCULATE(COUNT('Fact Table'[Entry_date]),('Date'[WeekNbrYear] = Count))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "('Fact Table'[Entry_date])" are dates customers have purchased from a store. The data type for this calculated column is set to Date: 14/03/01(d/mm/yy). I want to count each entry date and represent it in a visual card and for it to display only the latest week - be it a full 7 days (Monday to Sunday) or a couple of days (Mon to Tues).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have no problems displaying card counts for the last day or month available in my model - using the above DAX expression with appropriate modifications for day and month.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My week is from Monday to Sunday.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Time intelligence is on (I tried both on and off).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;'Date'[WeekNbrYear]&amp;nbsp;is a calculated column from my date table. Data type is text and ranges from Monday to Sunday:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WeekNbrYear = "W" &amp;amp; WEEKNUM ('Date'[Date],2) &amp;amp; " - " &amp;amp; YEAR ([Date])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below visual shows data for 2022 BUT the visual Card showing 1282 customers (W9-2022) instead of the latest being 356.&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 23:57:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-latest-week-of-data-available/m-p/2642305#M77620</guid>
      <dc:creator>matrix_user</dc:creator>
      <dc:date>2022-07-15T23:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Count the latest week of data available.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-latest-week-of-data-available/m-p/2642329#M77621</link>
      <description>&lt;P&gt;Latest week count =&lt;/P&gt;&lt;P&gt;VAR Count = MAX('Date'[WeekNbrYear])RETURN&lt;/P&gt;&lt;P&gt;CALCULATE(COUNT('Fact Table'[Entry_date]),('Date'[WeekNbrYear] = Count))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR Count = MAX('Date'[WeekNbrYear])&lt;/P&gt;&lt;P&gt;means the max number of whatever you select&lt;/P&gt;&lt;P&gt;if you want the max number without any select,&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR Count =&amp;nbsp; calculate(MAX('Date'[WeekNbrYear]),all(table))&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2022 00:38:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-latest-week-of-data-available/m-p/2642329#M77621</guid>
      <dc:creator>vapid128</dc:creator>
      <dc:date>2022-07-16T00:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Count the latest week of data available.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-latest-week-of-data-available/m-p/2642351#M77624</link>
      <description>&lt;P&gt;Not sure what you are saying... do you mean I should change my current DAX expression to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;Count =&amp;nbsp; calculate(MAX('Date'[WeekNbrYear]),all(table)),&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;CALCULATE(COUNT('Fact Table'[Entry_date]),('Date'[WeekNbrYear] = Count))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...because that doen't work.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2022 01:22:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-latest-week-of-data-available/m-p/2642351#M77624</guid>
      <dc:creator>matrix_user</dc:creator>
      <dc:date>2022-07-16T01:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Count the latest week of data available.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-latest-week-of-data-available/m-p/2642352#M77625</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Try this&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;VAR Count =&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;COUNT('Fact Table'[Entry_date]),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FILTER(All('Fact Table'),'Date'[WeekNbrYear] = MAX('Date'[WeekNbrYear]))&lt;BR /&gt;)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2022 01:30:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-latest-week-of-data-available/m-p/2642352#M77625</guid>
      <dc:creator>vapid128</dc:creator>
      <dc:date>2022-07-16T01:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Count the latest week of data available.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-latest-week-of-data-available/m-p/2642382#M77628</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Still not quiet working.&amp;nbsp; The 'WeekNbr_Year" is greyed out and an error message is saying something along the lines of needing an aggreagtion.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Weekly count = &lt;/SPAN&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;COUNT&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#0000FF"&gt;'Fact Table'[Entry_date]&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;'Fact Table'&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT color="#0000FF"&gt;)&lt;/FONT&gt;,&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;'Date'&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#999999"&gt;&lt;SPAN&gt;[WeekNbr_Year]&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#0000FF"&gt;'Date'[WeekNbr_Year]&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;EM&gt;&amp;nbsp;A single value for column 'WeekNbr_Year' in table 'Date' cannot be detewrmined. This can happen when a measure formula refers to a column that contains amny values without specifying an aggregation such as min,max,count, or sum to get a single result.&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 16 Jul 2022 03:26:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-latest-week-of-data-available/m-p/2642382#M77628</guid>
      <dc:creator>matrix_user</dc:creator>
      <dc:date>2022-07-16T03:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Count the latest week of data available.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-latest-week-of-data-available/m-p/2649907#M78086</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="329134" data-lia-user-login="matrix_user" class="lia-mention lia-mention-user"&gt;matrix_user&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you provide some sample data or simple pbix files? Sensitive information can be removed in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Charlotte&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.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 09:22:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-latest-week-of-data-available/m-p/2649907#M78086</guid>
      <dc:creator>v-zhangti</dc:creator>
      <dc:date>2022-07-20T09:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Count the latest week of data available.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-latest-week-of-data-available/m-p/2651108#M78154</link>
      <description>&lt;P&gt;OK,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Make a [wwekNbr_year] colnum in fact table,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;Weekly count =&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;COUNT&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#0000FF"&gt;'Fact Table'[Entry_date]&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;'Fact Table'&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT color="#0000FF"&gt;)&lt;/FONT&gt;,&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;'&lt;FONT color="#000000"&gt;Fact Table&lt;/FONT&gt;'&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#999999"&gt;&lt;SPAN&gt;[WeekNbr_Year]&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#0000FF"&gt;'&lt;FONT color="#000000"&gt;Fact Table&lt;/FONT&gt;'[WeekNbr_Year]&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 Jul 2022 17:31:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-latest-week-of-data-available/m-p/2651108#M78154</guid>
      <dc:creator>vapid128</dc:creator>
      <dc:date>2022-07-20T17:31:54Z</dc:date>
    </item>
  </channel>
</rss>

