<?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: Allocating contract amount over multiple years in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocating-contract-amount-over-multiple-years/m-p/2852022#M91465</link>
    <description>&lt;P&gt;Thank You!&lt;/P&gt;&lt;P&gt;I really appreciate it.&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;</description>
    <pubDate>Wed, 19 Oct 2022 19:16:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-10-19T19:16:04Z</dc:date>
    <item>
      <title>Allocating contract amount over multiple years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocating-contract-amount-over-multiple-years/m-p/2823987#M89715</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have an interesting question -&lt;/P&gt;&lt;P&gt;Working with contracts that are generally 1 year but sometimes they go multiple years.&lt;/P&gt;&lt;P&gt;Each contract has a contract id, start date, end date, and amount.&lt;/P&gt;&lt;P&gt;I need to show contract expenditure by year.&amp;nbsp; Straight forward when contract is for one year i.e. Jan 1, 2022 thru Dec 31, 2022.&lt;/P&gt;&lt;P&gt;How do i allocate the amount by year if a contract starts on Feb 1, 2021 and ends on Jan 31, 2024.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks!&lt;/P&gt;&lt;P&gt;Pav&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 21:22:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocating-contract-amount-over-multiple-years/m-p/2823987#M89715</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-06T21:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Allocating contract amount over multiple years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocating-contract-amount-over-multiple-years/m-p/2824449#M89753</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , refer if my blog on a similar topic can help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Measure way&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-or-end-date/ba-p/1503785" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-or-end-date/ba-p/1503785&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Tables &lt;BR /&gt;&lt;A href="https://amitchandak.medium.com/dax-get-all-dates-between-the-start-and-end-date-8f3dac4ff90b" target="_blank"&gt;https://amitchandak.medium.com/dax-get-all-dates-between-the-start-and-end-date-8f3dac4ff90b&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://amitchandak.medium.com/power-query-get-all-dates-between-the-start-and-end-date-9ad6a84cf5f2" target="_blank"&gt;https://amitchandak.medium.com/power-query-get-all-dates-between-the-start-and-end-date-9ad6a84cf5f2&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 03:41:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocating-contract-amount-over-multiple-years/m-p/2824449#M89753</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-10-07T03:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: Allocating contract amount over multiple years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocating-contract-amount-over-multiple-years/m-p/2824821#M89779</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, I made a sample, and here is my solution.&lt;/P&gt;
&lt;P&gt;Data sample:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Create a measure to calculate the total days between “start date” and “end date”.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total days =
DATEDIFF ( MAX ( 'Tabelle1'[start date] ), MAX ( 'Tabelle1'[end date] ), DAY ) + 1
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create three measures to calculate days of every year.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;2022 =
DATEDIFF ( MAX ( 'Tabelle1'[start date] ), DATE ( 2022, 12, 31 ), DAY ) + 1
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;2023 =
IF (
    MAX ( 'Tabelle1'[end date] ) &amp;gt; DATE ( 2022, 12, 31 ),
    DATEDIFF ( MAX ( 'Tabelle1'[start date] ), DATE ( 2023, 12, 31 ), DAY ) + 1 - 'Tabelle1'[2022]
)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;2024 =
IF (
    MAX ( 'Tabelle1'[end date] ) &amp;gt; DATE ( 2023, 12, 31 ),
    DATEDIFF ( MAX ( 'Tabelle1'[start date] ), MAX ( 'Tabelle1'[end date] ), DAY ) + 1 - 'Tabelle1'[2022] - 'Tabelle1'[2023]
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create three measures to calculate the amount of each year.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;amount of 2022 =
DIVIDE ( MAX ( 'Tabelle1'[amount] ), 'Tabelle1'[Total days] ) * 'Tabelle1'[2022]
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;amount of 2023 =
DIVIDE ( MAX ( 'Tabelle1'[amount] ), 'Tabelle1'[Total days] ) * 'Tabelle1'[2023]
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;amount of 2024 =
DIVIDE ( MAX ( 'Tabelle1'[amount] ), 'Tabelle1'[Total days] ) * 'Tabelle1'[2024]
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Final output:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I attach my sample below for your reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ xiaosun&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps,&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 07:29:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocating-contract-amount-over-multiple-years/m-p/2824821#M89779</guid>
      <dc:creator>v-xiaosun-msft</dc:creator>
      <dc:date>2022-10-07T07:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Allocating contract amount over multiple years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocating-contract-amount-over-multiple-years/m-p/2852022#M91465</link>
      <description>&lt;P&gt;Thank You!&lt;/P&gt;&lt;P&gt;I really appreciate it.&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 19:16:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocating-contract-amount-over-multiple-years/m-p/2852022#M91465</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-19T19:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Allocating contract amount over multiple years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocating-contract-amount-over-multiple-years/m-p/2852025#M91466</link>
      <description>&lt;P&gt;Thank You!&lt;/P&gt;&lt;P&gt;I really appreciate it.&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 19:16:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocating-contract-amount-over-multiple-years/m-p/2852025#M91466</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-19T19:16:23Z</dc:date>
    </item>
  </channel>
</rss>

