<?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: Month of Last Sales Date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Month-of-Last-Sales-Date/m-p/3662043#M141908</link>
    <description>&lt;P&gt;It seems like you're working with DAX formulas in Power BI or a similar tool to calculate the month of the most recent sales date. You're correct in assuming that you need to handle cases where a salesperson doesn't have a sale for the most recent sales date.&lt;/P&gt;&lt;P&gt;To address this issue, you should ensure that your calculation doesn't filter out the salesperson if they don't have a sale on the most recent date. You can achieve this by modifying your DAX formula as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Month of Max Date =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;MAX ( 'DIM Calendar'[Year-Period (Fiscal)] ),&lt;BR /&gt;FILTER (&lt;BR /&gt;ALL ( 'FACT Detail' ),&lt;BR /&gt;'FACT Detail'[Invoice Date] = [Max Date]&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;P&gt;Here's the breakdown of what's changed:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;ALL('FACT Detail')&lt;/STRONG&gt;: This function removes any filters applied to the 'FACT Detail' table, ensuring that all sales are considered when filtering for the most recent sales date.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;FILTER()&lt;/STRONG&gt;: This function applies a filter to the 'FACT Detail' table, selecting only the rows where the 'Invoice Date' matches the maximum date ([Max Date]).&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;By using the ALL function, you're ensuring that even if a salesperson doesn't have a sale on the most recent date, they are still considered when determining the month of the maximum date. This should prevent the month from going blank and keep your MTD (Month-to-Date) sales numbers intact.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jan 2024 05:54:01 GMT</pubDate>
    <dc:creator>123abc</dc:creator>
    <dc:date>2024-01-26T05:54:01Z</dc:date>
    <item>
      <title>Month of Last Sales Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Month-of-Last-Sales-Date/m-p/3661957#M141903</link>
      <description>&lt;P&gt;I'm trying to write a code showing the Month/Period of the Most recent Sales Date for anyone in the org.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my max date formula&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Max Date =&lt;/SPAN&gt; &lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Max&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'FACT Detail'&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;[Invoice Date]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;all&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'FACT Detail')&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This seems to work to display the max date for regardless of if the sales person had sales that day.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Here is my formula for Month of max date.&amp;nbsp; When a salesperson doesn't have a sale for the most recent sales date the month goes blank and his MTD Sales number disappear.&amp;nbsp; I want it to say Jan 202401&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Month of Max Date =&lt;/SPAN&gt; &lt;SPAN&gt;Calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;max&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'DIM Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[Year-Period (Fiscal)]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;filter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'FACT Detail'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'FACT Detail'&lt;/SPAN&gt;&lt;SPAN&gt;[Invoice Date]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;[Max Date]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I assume i have to throw an All on the FACT Detail table but where in the formula should i insert it?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;THanks,&lt;BR /&gt;Jim&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 26 Jan 2024 04:13:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Month-of-Last-Sales-Date/m-p/3661957#M141903</guid>
      <dc:creator>JimSales81</dc:creator>
      <dc:date>2024-01-26T04:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Month of Last Sales Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Month-of-Last-Sales-Date/m-p/3662043#M141908</link>
      <description>&lt;P&gt;It seems like you're working with DAX formulas in Power BI or a similar tool to calculate the month of the most recent sales date. You're correct in assuming that you need to handle cases where a salesperson doesn't have a sale for the most recent sales date.&lt;/P&gt;&lt;P&gt;To address this issue, you should ensure that your calculation doesn't filter out the salesperson if they don't have a sale on the most recent date. You can achieve this by modifying your DAX formula as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Month of Max Date =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;MAX ( 'DIM Calendar'[Year-Period (Fiscal)] ),&lt;BR /&gt;FILTER (&lt;BR /&gt;ALL ( 'FACT Detail' ),&lt;BR /&gt;'FACT Detail'[Invoice Date] = [Max Date]&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;P&gt;Here's the breakdown of what's changed:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;ALL('FACT Detail')&lt;/STRONG&gt;: This function removes any filters applied to the 'FACT Detail' table, ensuring that all sales are considered when filtering for the most recent sales date.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;FILTER()&lt;/STRONG&gt;: This function applies a filter to the 'FACT Detail' table, selecting only the rows where the 'Invoice Date' matches the maximum date ([Max Date]).&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;By using the ALL function, you're ensuring that even if a salesperson doesn't have a sale on the most recent date, they are still considered when determining the month of the maximum date. This should prevent the month from going blank and keep your MTD (Month-to-Date) sales numbers intact.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 05:54:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Month-of-Last-Sales-Date/m-p/3662043#M141908</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-01-26T05:54:01Z</dc:date>
    </item>
  </channel>
</rss>

