<?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: Duration per month between dates and for a specific year X daily cost per period in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-per-month-between-dates-and-for-a-specific-year-X-daily/m-p/2895297#M94087</link>
    <description>&lt;P&gt;Thank you. I'll be testing the solution.&lt;/P&gt;</description>
    <pubDate>Wed, 09 Nov 2022 12:23:25 GMT</pubDate>
    <dc:creator>marcosvcortes</dc:creator>
    <dc:date>2022-11-09T12:23:25Z</dc:date>
    <item>
      <title>Duration per month between dates and for a specific year X daily cost per period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-per-month-between-dates-and-for-a-specific-year-X-daily/m-p/2884246#M93438</link>
      <description>&lt;P&gt;On 2022-08-10 I posted an issue about "Duration per month between dates and for a specific year" and it has been resolved. The measure presented in Power BI was a success!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Look:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/Duration-per-month-between-dates-and-for-a-specific-year/m-p/2827338#M89926" target="_blank"&gt;https://community.powerbi.com/t5/DAX-Commands-and-Tips/Duration-per-month-between-dates-and-for-a-specific-year/m-p/2827338#M89926&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But now I came across the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Considering that the projects had a daily cost that varied according to a certain period, how could we know the total value of each project by month and year?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;BR /&gt;Project&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Daily&amp;nbsp; &amp;nbsp; Cost Start Period&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End Period&lt;BR /&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2.00&amp;nbsp; &amp;nbsp; &amp;nbsp; 12/01/2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 01/15/2023&lt;BR /&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3.00&amp;nbsp; &amp;nbsp; &amp;nbsp; 12/16/2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 01/30/2023&lt;BR /&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2.00&amp;nbsp; &amp;nbsp; &amp;nbsp; 12/01/2023&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12/15/2023&lt;BR /&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5.00&amp;nbsp; &amp;nbsp; &amp;nbsp; 12/16/2023&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 01/30/2024&lt;BR /&gt;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3.00&amp;nbsp; &amp;nbsp; &amp;nbsp; 10/01/2023&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11/15/2023&lt;BR /&gt;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4.00&amp;nbsp; &amp;nbsp; &amp;nbsp; 10/16/2023&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11/30/2023&lt;BR /&gt;D&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.00&amp;nbsp; &amp;nbsp; &amp;nbsp; 12/01/2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;06/30/2023&lt;BR /&gt;D&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2.00&amp;nbsp; &amp;nbsp; &amp;nbsp; 01/07/2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30/01/2024&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 01:52:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-per-month-between-dates-and-for-a-specific-year-X-daily/m-p/2884246#M93438</guid>
      <dc:creator>marcosvcortes00</dc:creator>
      <dc:date>2022-11-04T01:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Duration per month between dates and for a specific year X daily cost per period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-per-month-between-dates-and-for-a-specific-year-X-daily/m-p/2884287#M93442</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="453576" data-lia-user-login="marcosvcortes00" class="lia-mention lia-mention-user"&gt;marcosvcortes00&lt;/a&gt; , refer if one of these approaches can help &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&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;
&lt;P&gt;Measure way&lt;BR /&gt;Power BI Dax Measure- Allocate data between Range: &lt;A href="https://youtu.be/O653vwLTUzM" target="_blank"&gt;https://youtu.be/O653vwLTUzM&lt;/A&gt;&lt;BR /&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;</description>
      <pubDate>Fri, 04 Nov 2022 02:11:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-per-month-between-dates-and-for-a-specific-year-X-daily/m-p/2884287#M93442</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-11-04T02:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Duration per month between dates and for a specific year X daily cost per period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-per-month-between-dates-and-for-a-specific-year-X-daily/m-p/2885311#M93502</link>
      <description>&lt;P&gt;It would be interesting to measure a DAX that was in accordance with the solution given by &lt;STRONG&gt;CNENFRNL&lt;/STRONG&gt;, available in PBIX at:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/Duration-per-month-between-dates-and-for-a-specific-year/m-p/2827338#M89926" target="_blank"&gt;Solved: Duration per month between dates and for a specifi... - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 10:20:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-per-month-between-dates-and-for-a-specific-year-X-daily/m-p/2885311#M93502</guid>
      <dc:creator>marcosvcortes</dc:creator>
      <dc:date>2022-11-04T10:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Duration per month between dates and for a specific year X daily cost per period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-per-month-between-dates-and-for-a-specific-year-X-daily/m-p/2887346#M93629</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2022 02:19:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-per-month-between-dates-and-for-a-specific-year-X-daily/m-p/2887346#M93629</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2022-11-06T02:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Duration per month between dates and for a specific year X daily cost per period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-per-month-between-dates-and-for-a-specific-year-X-daily/m-p/2889448#M93746</link>
      <description>&lt;P&gt;Duration per month between dates and for a specific year X daily cost per period&lt;BR /&gt;I appreciate you answering me, but I wanted to improve my question.&lt;/P&gt;&lt;P&gt;The idea would be to multiply the costs below, considering each period (variable cost):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;BR /&gt;Resource Cost Cost Start Period End Period&lt;BR /&gt;1 2.00 01/12/2022 15/01/2023&lt;BR /&gt;1 3.00 16/01/2022 30/01/2023&lt;BR /&gt;2 2.00 01/12/2023 15/12/2023&lt;BR /&gt;3 5.00 16/12/2023 30/01/2024&lt;BR /&gt;3 3.00 01/10/2023 15/11/2023&lt;BR /&gt;4 4.00 16/10/2023 30/11/2023&lt;BR /&gt;4 1.00 01/12/2022 30/06/2023&lt;BR /&gt;D 2.00 01/07/2022 30/01/2024&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Considering the periods of each project:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Project Start End Duration Resource&lt;BR /&gt;A 01/12/2022 30/01/2023 60 1&lt;BR /&gt;B 01/12/2023 30/01/2024 60 2&lt;BR /&gt;C 01/10/2023 30/11/2023 60 3&lt;BR /&gt;D 01/12/2022 30/01/2024 425 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know the total cost of each project.&lt;/P&gt;&lt;P&gt;Note that project A uses feature 1, which has two costs: 2.00, between 12/01/2022 to 15/01/2023 and 3.00, between 16/01/2022 to 30/01/2023.The total of project A should be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;31 * 2 = 62&lt;/P&gt;&lt;P&gt;15 * 2 = 30&lt;BR /&gt;16 * 3 = 48&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;62 + 30 + 48 = 140&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 14:01:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-per-month-between-dates-and-for-a-specific-year-X-daily/m-p/2889448#M93746</guid>
      <dc:creator>marcosvcortes</dc:creator>
      <dc:date>2022-11-07T14:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Duration per month between dates and for a specific year X daily cost per period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-per-month-between-dates-and-for-a-specific-year-X-daily/m-p/2890686#M93823</link>
      <description>&lt;P&gt;Efficiency aside, just offer some ideas&lt;/P&gt;
&lt;P&gt;firstly create a date table, DatesTable&lt;/P&gt;
&lt;P&gt;then create a measure&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;CostTotal = 
SUMX (
    'ProjectTable',
    VAR _dates =
        DATESBETWEEN ( 'DatesTable'[Date], 'ProjectTable'[Start], 'ProjectTable'[End] )
    RETURN
        SUMX (
            FILTER ( CostTable, CostTable[Resource] = 'ProjectTable'[Resource] ),
            COUNTROWS (
                INTERSECT (
                    _dates,
                    DATESBETWEEN (
                        'DatesTable'[Date],
                        CostTable[Start Period ],
                        CostTable[End Period]
                    )
                )
            ) * CostTable[Cost]
        )
)&lt;/LI-CODE&gt;
&lt;P&gt;the result look like this&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 01:51:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-per-month-between-dates-and-for-a-specific-year-X-daily/m-p/2890686#M93823</guid>
      <dc:creator>wdx223_Daniel</dc:creator>
      <dc:date>2022-11-08T01:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Duration per month between dates and for a specific year X daily cost per period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-per-month-between-dates-and-for-a-specific-year-X-daily/m-p/2895297#M94087</link>
      <description>&lt;P&gt;Thank you. I'll be testing the solution.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 12:23:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-per-month-between-dates-and-for-a-specific-year-X-daily/m-p/2895297#M94087</guid>
      <dc:creator>marcosvcortes</dc:creator>
      <dc:date>2022-11-09T12:23:25Z</dc:date>
    </item>
  </channel>
</rss>

