<?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: Simplifying DAX for POS Data in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simplifying-DAX-for-POS-Data/m-p/2541920#M71622</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;Do you have your pos results with a date field in separate table? If you have a separate date table, all those calculations are very straightforward. If you feel like sharing an example I will check it out a bit later today. Thanks..&lt;/P&gt;</description>
    <pubDate>Thu, 26 May 2022 16:58:49 GMT</pubDate>
    <dc:creator>Whitewater100</dc:creator>
    <dc:date>2022-05-26T16:58:49Z</dc:date>
    <item>
      <title>Simplifying DAX for POS Data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simplifying-DAX-for-POS-Data/m-p/2541762#M71609</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have been asked to revise some current measures that someone created before my time. I have spent the last 4 days researching and rewriting the DAX and nothing works. I have to revise measures for: this month, last month, this quarter, last quarter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see the current DAX measures below for reference. Any feedback on minimizing the amount of DAX that is used in these measures is GREATLY APPRECIATED.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;last mo POS = 
VAR this_wk = CALCULATE(MAX('POS Weekly All Accounts Sales'[Week End Date]))

RETURN
CALCULATE(
'POS Weekly All Accounts Sales'[POS Units Sold], 
'Calendar'[Week End Date] = this_wk -28
|| 'Calendar'[Week End Date] = this_wk - 35
|| 'Calendar'[Week End Date] = this_wk - 42
|| 'Calendar'[Week End Date] = this_wk - 49
)


this mo POS = 
VAR this_wk = CALCULATE(MAX('POS Weekly All Accounts Sales'[Week End Date]))

RETURN 
CALCULATE(
'POS Weekly All Accounts Sales'[POS Units Sold], 
'Calendar'[Week End Date] = this_wk
|| 'Calendar'[Week End Date] = this_wk - 7
|| 'Calendar'[Week End Date] = this_wk - 14
|| 'Calendar'[Week End Date] = this_wk - 21
)


last Q POS = 
VAR this_wk = CALCULATE(MAX('POS Weekly All Accounts Sales'[Week End Date]))

RETURN
CALCULATE(
'POS Weekly All Accounts Sales'[POS Units Sold], 
'Calendar'[Week End Date] = this_wk - 91
|| 'Calendar'[Week End Date] = this_wk - 98
|| 'Calendar'[Week End Date] = this_wk - 105
|| 'Calendar'[Week End Date] = this_wk - 112
|| 'Calendar'[Week End Date] = this_wk - 119
|| 'Calendar'[Week End Date] = this_wk - 126
|| 'Calendar'[Week End Date] = this_wk - 133
|| 'Calendar'[Week End Date] = this_wk - 140
|| 'Calendar'[Week End Date] = this_wk - 147
|| 'Calendar'[Week End Date] = this_wk - 154
|| 'Calendar'[Week End Date] = this_wk - 161
|| 'Calendar'[Week End Date] = this_wk - 168
|| 'Calendar'[Week End Date] = this_wk - 175
)


this Q POS = 
VAR this_wk = CALCULATE(MAX('POS Weekly All Accounts Sales'[Week End Date]))

RETURN 
CALCULATE(
'POS Weekly All Accounts Sales'[POS Units Sold], 
'Calendar'[Week End Date] = this_wk
|| 'Calendar'[Week End Date] = this_wk - 7
|| 'Calendar'[Week End Date] = this_wk - 14
|| 'Calendar'[Week End Date] = this_wk - 21
|| 'Calendar'[Week End Date] = this_wk - 28
|| 'Calendar'[Week End Date] = this_wk - 35
|| 'Calendar'[Week End Date] = this_wk - 42
|| 'Calendar'[Week End Date] = this_wk - 49
|| 'Calendar'[Week End Date] = this_wk - 56
|| 'Calendar'[Week End Date] = this_wk - 63
|| 'Calendar'[Week End Date] = this_wk - 70
|| 'Calendar'[Week End Date] = this_wk - 77
|| 'Calendar'[Week End Date] = this_wk - 84
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 15:17:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simplifying-DAX-for-POS-Data/m-p/2541762#M71609</guid>
      <dc:creator>ariana_night</dc:creator>
      <dc:date>2022-05-26T15:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Simplifying DAX for POS Data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simplifying-DAX-for-POS-Data/m-p/2541920#M71622</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;Do you have your pos results with a date field in separate table? If you have a separate date table, all those calculations are very straightforward. If you feel like sharing an example I will check it out a bit later today. Thanks..&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 16:58:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simplifying-DAX-for-POS-Data/m-p/2541920#M71622</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-05-26T16:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Simplifying DAX for POS Data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simplifying-DAX-for-POS-Data/m-p/2541978#M71626</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;The table looks like this (using Month over Month example):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This Month and Last Month POS Units sold in 2 different columns. I thought using&amp;nbsp; DATESBETWEEN or DATESINPERIOD would shorten the DAX but either it does not work or I am not using them correctly. As far as relationships, the 'pos weekly all accounts [week end date]' and 'calendar [week end date]' connected. I hope I answered your question.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 17:31:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simplifying-DAX-for-POS-Data/m-p/2541978#M71626</guid>
      <dc:creator>ariana_night</dc:creator>
      <dc:date>2022-05-26T17:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Simplifying DAX for POS Data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simplifying-DAX-for-POS-Data/m-p/2549664#M72101</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="391346" data-lia-user-login="ariana_night" class="lia-mention lia-mention-user"&gt;ariana_night&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try to create your measures like so:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;last mo POS =
CALCULATE (
    'POS Weekly All Accounts Sales'[POS Units Sold],
    DATESINPERIOD ( 'Calendar'[Date], MAX ( 'Calendar'[Date] ), - 1, MONTH )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Icey&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 08:47:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simplifying-DAX-for-POS-Data/m-p/2549664#M72101</guid>
      <dc:creator>Icey</dc:creator>
      <dc:date>2022-05-31T08:47:09Z</dc:date>
    </item>
  </channel>
</rss>

