<?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 Calculate amount depending on customer and customer purchase date (Sample file linked) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-depending-on-customer-and-customer-purchase/m-p/3995909#M155240</link>
    <description>&lt;P&gt;Sorry, I marked it as solved and the post was moved to DAX commands and tips. But it was not solved. Please use the sample file to see the effect of the dateslider when trying to help with the measures &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="7987" data-lia-user-login="Member123456" class="lia-mention lia-mention-user"&gt;Member123456&lt;/a&gt; plz delete the other post in 'DAX commands and tips' since it is not solved yet.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have this data:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;A title="Samplefile" href="https://drive.google.com/file/d/1SlKQobvylDYylkmB5YO2UOZ8CxK_HrpL/view?usp=sharing" target="_blank" rel="noopener"&gt;https://drive.google.com/file/d/1SlKQobvylDYylkmB5YO2UOZ8CxK_HrpL/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The joins are as shown:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In my example I created a column called FirstSubscription which is the first date when then bought the Category = "subscription"&lt;BR /&gt;&lt;BR /&gt;So for customer 123 it is 30. june 2023 and 456 it is 12. january 2023.&lt;BR /&gt;&lt;BR /&gt;I then sum all categories that were bought before that time respectively after that date with the category "Subscription" included. That gives me these results:&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;&lt;P&gt;Using these measures:&lt;/P&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;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SumAmountAfter = 

    CALCULATE(
        SUM(Tabel[Amount]),
        USERELATIONSHIP(DimDato[Date],Tabel[FirstSubscription]),
        Tabel[DatoKeyStoettePeriode] &amp;gt;= Tabel[FirstSubscription]
    )&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;&amp;nbsp;&lt;/P&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;LI-CODE lang="markup"&gt;SumAmountBefore = 

    CALCULATE(
        SUM(Tabel[Amount]),
        USERELATIONSHIP(DimDato[Date],Tabel[FirstSubscription]),
        Tabel[FirstSubscription] &amp;gt;= Tabel[DatoKeyStoettePeriode]
    )&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My real table consists of 7 mio. lines and I would prefer to avoid adding a column with the FirstSubscription date that is in my sample file.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;So my question is, can I do this without having the column FirstSubscription and instead calculate for each customer the&amp;nbsp;FirstSubscription date and use it in my measures above?&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jun 2024 10:42:39 GMT</pubDate>
    <dc:creator>Bokazoit</dc:creator>
    <dc:date>2024-06-17T10:42:39Z</dc:date>
    <item>
      <title>Calculate amount depending on customer and customer purchase date (Sample file linked)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-depending-on-customer-and-customer-purchase/m-p/3995909#M155240</link>
      <description>&lt;P&gt;Sorry, I marked it as solved and the post was moved to DAX commands and tips. But it was not solved. Please use the sample file to see the effect of the dateslider when trying to help with the measures &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="7987" data-lia-user-login="Member123456" class="lia-mention lia-mention-user"&gt;Member123456&lt;/a&gt; plz delete the other post in 'DAX commands and tips' since it is not solved yet.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have this data:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;A title="Samplefile" href="https://drive.google.com/file/d/1SlKQobvylDYylkmB5YO2UOZ8CxK_HrpL/view?usp=sharing" target="_blank" rel="noopener"&gt;https://drive.google.com/file/d/1SlKQobvylDYylkmB5YO2UOZ8CxK_HrpL/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The joins are as shown:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In my example I created a column called FirstSubscription which is the first date when then bought the Category = "subscription"&lt;BR /&gt;&lt;BR /&gt;So for customer 123 it is 30. june 2023 and 456 it is 12. january 2023.&lt;BR /&gt;&lt;BR /&gt;I then sum all categories that were bought before that time respectively after that date with the category "Subscription" included. That gives me these results:&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;&lt;P&gt;Using these measures:&lt;/P&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;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SumAmountAfter = 

    CALCULATE(
        SUM(Tabel[Amount]),
        USERELATIONSHIP(DimDato[Date],Tabel[FirstSubscription]),
        Tabel[DatoKeyStoettePeriode] &amp;gt;= Tabel[FirstSubscription]
    )&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;&amp;nbsp;&lt;/P&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;LI-CODE lang="markup"&gt;SumAmountBefore = 

    CALCULATE(
        SUM(Tabel[Amount]),
        USERELATIONSHIP(DimDato[Date],Tabel[FirstSubscription]),
        Tabel[FirstSubscription] &amp;gt;= Tabel[DatoKeyStoettePeriode]
    )&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My real table consists of 7 mio. lines and I would prefer to avoid adding a column with the FirstSubscription date that is in my sample file.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;So my question is, can I do this without having the column FirstSubscription and instead calculate for each customer the&amp;nbsp;FirstSubscription date and use it in my measures above?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 10:42:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-depending-on-customer-and-customer-purchase/m-p/3995909#M155240</guid>
      <dc:creator>Bokazoit</dc:creator>
      <dc:date>2024-06-17T10:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate amount depending on customer and customer purchase date (Sample file linked)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-depending-on-customer-and-customer-purchase/m-p/3997282#M155431</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="6923" data-lia-user-login="Bokazoit" class="lia-mention lia-mention-user"&gt;Bokazoit&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do not have a FirstSubscription date column in your data, I recommend that you create a new column for FirstSubscription date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the simplest way that you can use your original code to achieve the goal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Nono Chen&lt;/P&gt;
&lt;P&gt;If this &lt;STRONG&gt;&lt;EM&gt;post&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;helps, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 03:05:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-depending-on-customer-and-customer-purchase/m-p/3997282#M155431</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-18T03:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate amount depending on customer and customer purchase date (Sample file linked)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-depending-on-customer-and-customer-purchase/m-p/3997511#M155448</link>
      <description>&lt;P&gt;I know that, I was looking for a solution without having to populate a tabel with that only information&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 05:56:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-depending-on-customer-and-customer-purchase/m-p/3997511#M155448</guid>
      <dc:creator>Bokazoit</dc:creator>
      <dc:date>2024-06-18T05:56:37Z</dc:date>
    </item>
  </channel>
</rss>

