<?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 Flag to show no sales in last 4 months for a &amp;quot;Customer&amp;quot; by &amp;quot;State&amp;quot; and &amp;quot;Product&amp;quot; in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Flag-to-show-no-sales-in-last-4-months-for-a-quot-Customer-quot/m-p/2203015#M51747</link>
    <description>&lt;P&gt;Hi Community&lt;/P&gt;&lt;P&gt;I'm newbie to the world of DAX and I'm hopping someone can assist me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I require a DAX calculation (if it's possible) to give me a flag when a customer has no sales of a product within the last 4 months for their state's product ranging only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been able to get the below to work to find the gaps but they do not allow state specific products, It shows everything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All my sales are in one query table "Actuals"&lt;/P&gt;&lt;P&gt;Actuals[9LE] = sales&lt;/P&gt;&lt;P&gt;Actuals[CUSTOMER_DIM.CUSTOMERNAME] = Customers&lt;/P&gt;&lt;P&gt;Actuals[STATE] = State&lt;/P&gt;&lt;P&gt;Actuals[ALMCode] = Products&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For for months I used a rolling sales calculation, and variations for 6 and 12;&lt;/P&gt;&lt;P&gt;=VAR EndDate=MAX(Dates[DATE])&lt;BR /&gt;VAR StartDate=EDATE(EndDate,-3)&lt;BR /&gt;VAR Result=&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM(Actuals[9LE]),&lt;BR /&gt;DATESBETWEEN(Dates[DATE],StartDate,EndDate)&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;Result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I used the below to flag the issues;&lt;/P&gt;&lt;P&gt;=IF([Last 12Mths 9LE]&amp;lt;=0,0,IF(OR([Last 6Mths 9LE]&amp;lt;=0,[Last 6Mths 9LE]&amp;gt;0&amp;amp;&amp;amp;[Last 4 Mths 9LE]&amp;lt;=0),1,0))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could be going totally down the wrong path. Happy to rewrite it all if required.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Appreciate your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks Brad&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Nov 2021 06:51:06 GMT</pubDate>
    <dc:creator>bjosic</dc:creator>
    <dc:date>2021-11-23T06:51:06Z</dc:date>
    <item>
      <title>Flag to show no sales in last 4 months for a "Customer" by "State" and "Product"</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Flag-to-show-no-sales-in-last-4-months-for-a-quot-Customer-quot/m-p/2203015#M51747</link>
      <description>&lt;P&gt;Hi Community&lt;/P&gt;&lt;P&gt;I'm newbie to the world of DAX and I'm hopping someone can assist me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I require a DAX calculation (if it's possible) to give me a flag when a customer has no sales of a product within the last 4 months for their state's product ranging only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been able to get the below to work to find the gaps but they do not allow state specific products, It shows everything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All my sales are in one query table "Actuals"&lt;/P&gt;&lt;P&gt;Actuals[9LE] = sales&lt;/P&gt;&lt;P&gt;Actuals[CUSTOMER_DIM.CUSTOMERNAME] = Customers&lt;/P&gt;&lt;P&gt;Actuals[STATE] = State&lt;/P&gt;&lt;P&gt;Actuals[ALMCode] = Products&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For for months I used a rolling sales calculation, and variations for 6 and 12;&lt;/P&gt;&lt;P&gt;=VAR EndDate=MAX(Dates[DATE])&lt;BR /&gt;VAR StartDate=EDATE(EndDate,-3)&lt;BR /&gt;VAR Result=&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM(Actuals[9LE]),&lt;BR /&gt;DATESBETWEEN(Dates[DATE],StartDate,EndDate)&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;Result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I used the below to flag the issues;&lt;/P&gt;&lt;P&gt;=IF([Last 12Mths 9LE]&amp;lt;=0,0,IF(OR([Last 6Mths 9LE]&amp;lt;=0,[Last 6Mths 9LE]&amp;gt;0&amp;amp;&amp;amp;[Last 4 Mths 9LE]&amp;lt;=0),1,0))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could be going totally down the wrong path. Happy to rewrite it all if required.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Appreciate your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks Brad&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 06:51:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Flag-to-show-no-sales-in-last-4-months-for-a-quot-Customer-quot/m-p/2203015#M51747</guid>
      <dc:creator>bjosic</dc:creator>
      <dc:date>2021-11-23T06:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Flag to show no sales in last 4 months for a "Customer" by "State" and "Product"</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Flag-to-show-no-sales-in-last-4-months-for-a-quot-Customer-quot/m-p/2203701#M51775</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="340613" data-lia-user-login="bjosic" class="lia-mention lia-mention-user"&gt;bjosic&lt;/a&gt; , last 4 months sales for any combination. With a separate date tbale &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling 4= CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-4,MONTH))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No sales for last 4 month = if(isblank([Rolling 4]), 1, 0)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;a approch I followed here&lt;/P&gt;
&lt;P&gt;Customer Retention Part 1:&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/ba-p/1361529" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/ba-p/1361529&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 12:56:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Flag-to-show-no-sales-in-last-4-months-for-a-quot-Customer-quot/m-p/2203701#M51775</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-11-23T12:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Flag to show no sales in last 4 months for a "Customer" by "State" and "Product"</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Flag-to-show-no-sales-in-last-4-months-for-a-quot-Customer-quot/m-p/2205146#M51860</link>
      <description>&lt;P&gt;Thanks &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do have a seperate date table already.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But solultion will not work, I only want to flag a customer if the customer has not purchase in the last 4 months. The formula above shows a flag if the customer has also have never purchased it, not what I'm looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did get around that issue with adding in rolling 12 and changing the lost sales to show&lt;/P&gt;&lt;P&gt;IF(ISBLANK([Rolling 12 months]),0,IF(ISBLANK([Rolling 4 Mths]),1,0))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this still leaves me in the exact same spot as I was in the beginning. The cutomer report still shows all customers and products, not just the ones ranged for that state.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to somehow restrict the products for that state and for the customers with that state.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regard&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;</description>
      <pubDate>Wed, 24 Nov 2021 07:07:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Flag-to-show-no-sales-in-last-4-months-for-a-quot-Customer-quot/m-p/2205146#M51860</guid>
      <dc:creator>bjosic</dc:creator>
      <dc:date>2021-11-24T07:07:35Z</dc:date>
    </item>
  </channel>
</rss>

