<?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 the number of weeks between the two date rows in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Calculate-the-number-of-weeks-between-the-two-date-rows/m-p/2144982#M32483</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to calculate the number of weeks between the two date rows based on the category start date and finish date as shown below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Oct 2021 07:44:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-10-20T07:44:09Z</dc:date>
    <item>
      <title>Calculate the number of weeks between the two date rows</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Calculate-the-number-of-weeks-between-the-two-date-rows/m-p/2144982#M32483</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to calculate the number of weeks between the two date rows based on the category start date and finish date as shown below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 07:44:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Calculate-the-number-of-weeks-between-the-two-date-rows/m-p/2144982#M32483</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-20T07:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the number of weeks between the two date rows</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Calculate-the-number-of-weeks-between-the-two-date-rows/m-p/2150029#M32527</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try to use datediff function in your code.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Weekdiff = 
VAR _T =
    SUMMARIZE (
        'Table',
        'Table'[SDCCode],
        "Weekdiff",
            VAR _LoadStartDate =
                CALCULATE (
                    MAX ( 'Table'[Date] ),
                    FILTER ( 'Table', 'Table'[Category] = "03.WO Load Start Date" )
                )
            VAR _LoadFinishDate =
                CALCULATE (
                    MAX ( 'Table'[Date] ),
                    FILTER ( 'Table', 'Table'[Category] = "04.WO Load Finish Date" )
                )
            RETURN
                DATEDIFF ( _LoadStartDate, _LoadFinishDate, WEEK )
    )
RETURN
    SUMX ( _T, [Weekdiff] )&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 09:01:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Calculate-the-number-of-weeks-between-the-two-date-rows/m-p/2150029#M32527</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-22T09:01:51Z</dc:date>
    </item>
  </channel>
</rss>

