<?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: Volume lost for 12 months prior to customer loss in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3679333#M142869</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="299232" data-lia-user-login="BudMan512" class="lia-mention lia-mention-user"&gt;BudMan512&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) My test data is the same as yours.&lt;/P&gt;
&lt;P&gt;(2) We can create a calculated column on&amp;nbsp;&lt;SPAN&gt;Customer table.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Gallons lost =
VAR _date =
    EDATE ( [End Date], -12 )
RETURN
    CALCULATE (
        SUM ( 'Sales'[Gallons] ),
        FILTER (
            'Sales',
            Sales[Account] = EARLIER ( 'Customer'[Account] )
                &amp;amp;&amp;amp; 'Sales'[Delivery Date] &amp;gt;= _date
                &amp;amp;&amp;amp; 'Sales'[Delivery Date] &amp;lt;= EARLIER ( 'Customer'[End Date] )
        )
    )
&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;&lt;img /&gt;&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;&lt;EM&gt;helps&lt;/EM&gt;&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>Mon, 05 Feb 2024 06:24:17 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-02-05T06:24:17Z</dc:date>
    <item>
      <title>Volume lost for 12 months prior to customer loss</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3670934#M142408</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="177566" data-lia-user-login="speedramps" class="lia-mention lia-mention-user"&gt;speedramps&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to determine the number of Gallons Lost during the 12-month period, prior to the End Date of the Account.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are three tables provided in the data. A link to the data is provided.&lt;/P&gt;&lt;P&gt;Here is the Customer table. The End Date is the date a customer is lost.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each customer has deliveries of fuel that are measured in Gallons.&amp;nbsp; Some of the deliveries fall within the 12 months prior to the end date and some do not. I need only the gallons that do fall within that time period.&lt;/P&gt;&lt;P&gt;Here is the Sales Table&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also included in the data is a Calendar table ranging from 1/1/2022 to 12/31/2024.&lt;/P&gt;&lt;P&gt;One complication with the Calendar Table is that it is used for both the End Date of the customer and elsewhere in the report, for the customer Start Date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In conclusion, I need the sum of Gallons Lost for the 12 months prior to the customer’s End Date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the link to an Excel spreadsheet containing the data tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="Customers lost with previous years gallons gallons" href="http:// https://1drv.ms/x/s!An-c-kQsqoNPglOF0ahWAx-kJHQh?e=uqaV1Q" target="_self"&gt;https://1drv.ms/x/s!An-c-kQsqoNPglOF0ahWAx-kJHQh?e=uqaV1Q&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 17:07:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3670934#M142408</guid>
      <dc:creator>BudMan512</dc:creator>
      <dc:date>2024-01-31T17:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Volume lost for 12 months prior to customer loss</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3671074#M142411</link>
      <description>&lt;P&gt;We want to help you but you keep posting links that do not work.&lt;/P&gt;&lt;P&gt;Please ask friend, collegaue or manager to help show you how to share example data exeternally via OneDrive, Dropbox or Sharepoint.&lt;/P&gt;&lt;P&gt;It just wastes your time and our time if you keep sharing broken links. Thank you&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 17:59:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3671074#M142411</guid>
      <dc:creator>speedramps</dc:creator>
      <dc:date>2024-01-31T17:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Volume lost for 12 months prior to customer loss</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3671105#M142412</link>
      <description>&lt;P&gt;My apologies,&amp;nbsp; I tested the link several time and it worked fine.&amp;nbsp; I will get&amp;nbsp; one that works.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 18:27:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3671105#M142412</guid>
      <dc:creator>BudMan512</dc:creator>
      <dc:date>2024-01-31T18:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: Volume lost for 12 months prior to customer loss</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3671335#M142421</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="177566" data-lia-user-login="speedramps" class="lia-mention lia-mention-user"&gt;speedramps&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Hopefully this one works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/scl/fi/hk8lm12ertmgbm1828jqb/Customers-lost-with-previous-years-gallons-1.xlsx?rlkey=ek3kedl446up7qz7j6da45ujs&amp;amp;dl=0" target="_blank"&gt;https://www.dropbox.com/scl/fi/hk8lm12ertmgbm1828jqb/Customers-lost-with-previous-years-gallons-1.xlsx?rlkey=ek3kedl446up7qz7j6da45ujs&amp;amp;dl=0&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 22:04:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3671335#M142421</guid>
      <dc:creator>BudMan512</dc:creator>
      <dc:date>2024-01-31T22:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Volume lost for 12 months prior to customer loss</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3679333#M142869</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="299232" data-lia-user-login="BudMan512" class="lia-mention lia-mention-user"&gt;BudMan512&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) My test data is the same as yours.&lt;/P&gt;
&lt;P&gt;(2) We can create a calculated column on&amp;nbsp;&lt;SPAN&gt;Customer table.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Gallons lost =
VAR _date =
    EDATE ( [End Date], -12 )
RETURN
    CALCULATE (
        SUM ( 'Sales'[Gallons] ),
        FILTER (
            'Sales',
            Sales[Account] = EARLIER ( 'Customer'[Account] )
                &amp;amp;&amp;amp; 'Sales'[Delivery Date] &amp;gt;= _date
                &amp;amp;&amp;amp; 'Sales'[Delivery Date] &amp;lt;= EARLIER ( 'Customer'[End Date] )
        )
    )
&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;&lt;img /&gt;&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;&lt;EM&gt;helps&lt;/EM&gt;&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>Mon, 05 Feb 2024 06:24:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3679333#M142869</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-05T06:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Volume lost for 12 months prior to customer loss</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3681142#M142953</link>
      <description>&lt;P&gt;Thank you Neeko,&amp;nbsp; I appreciate your help.&amp;nbsp; I may not be able to try this until tomorrow but I would be happy to mark it as complete.&amp;nbsp; It looks good, thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 19:46:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3681142#M142953</guid>
      <dc:creator>BudMan512</dc:creator>
      <dc:date>2024-02-05T19:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Volume lost for 12 months prior to customer loss</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3681457#M142966</link>
      <description>&lt;P&gt;@v-tangjir-msft&lt;/P&gt;&lt;P&gt;Hi Neeko, this worked perfectly.&amp;nbsp; Thank you for helping me.&lt;/P&gt;&lt;P&gt;Bud&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 23:31:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3681457#M142966</guid>
      <dc:creator>BudMan512</dc:creator>
      <dc:date>2024-02-05T23:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Volume lost for 12 months prior to customer loss</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3681473#M142967</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="177566" data-lia-user-login="speedramps" class="lia-mention lia-mention-user"&gt;speedramps&lt;/a&gt;&lt;/P&gt;&lt;P&gt;As I did not hear back from you on this I assume yet another data link bit the dust.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even though I couldn't give you the solution on this, I did learn a lot from you about the&amp;nbsp; process, so thank you for that.&lt;/P&gt;&lt;P&gt;Bud&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 23:34:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3681473#M142967</guid>
      <dc:creator>BudMan512</dc:creator>
      <dc:date>2024-02-05T23:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: Volume lost for 12 months prior to customer loss</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3681483#M142968</link>
      <description>&lt;P&gt;Hi Bud&lt;/P&gt;&lt;P&gt;I will try take a look tomorrow.&lt;/P&gt;&lt;P&gt;I am unpaid volunteer but like to help&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 23:38:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3681483#M142968</guid>
      <dc:creator>speedramps</dc:creator>
      <dc:date>2024-02-05T23:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: Volume lost for 12 months prior to customer loss</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3683124#M143051</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="177566" data-lia-user-login="speedramps" class="lia-mention lia-mention-user"&gt;speedramps&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Someone else has provided the Solution to my question.&lt;/P&gt;&lt;P&gt;Thank you for the time you invested to help me better understand the process.&lt;/P&gt;&lt;P&gt;I do appreciate it.&lt;/P&gt;&lt;P&gt;Bud&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2024 13:46:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3683124#M143051</guid>
      <dc:creator>BudMan512</dc:creator>
      <dc:date>2024-02-06T13:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Volume lost for 12 months prior to customer loss</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3688644#M143312</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Hi Neeko,&lt;/P&gt;&lt;P&gt;I have run into a snag with the provided formula. Results are wrong when there are 2 or more customers with the same end date and the values are duplicated.&amp;nbsp; Below is a screenshot of the problem.&lt;/P&gt;&lt;P&gt;I wonder if you would mind taking a look at this?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bud&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 14:49:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Volume-lost-for-12-months-prior-to-customer-loss/m-p/3688644#M143312</guid>
      <dc:creator>BudMan512</dc:creator>
      <dc:date>2024-02-08T14:49:46Z</dc:date>
    </item>
  </channel>
</rss>

