<?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 days in between two dates for each year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-days-in-between-two-dates-for-each-year/m-p/2263756#M54792</link>
    <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know how you calculate days in between two dates for each year. So you could make a diagram like this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jan 2022 15:43:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-01-03T15:43:24Z</dc:date>
    <item>
      <title>Calculate days in between two dates for each year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-days-in-between-two-dates-for-each-year/m-p/2263756#M54792</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know how you calculate days in between two dates for each year. So you could make a diagram like this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 15:43:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-days-in-between-two-dates-for-each-year/m-p/2263756#M54792</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-03T15:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate days in between two dates for each year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-days-in-between-two-dates-for-each-year/m-p/2263807#M54796</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp; you can write a meaure like this&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR _fact =
    FILTER (
        GENERATE ( tbl, DATESBETWEEN ( 'Calendar'[Date], tbl[Begin], tbl[End] ) ),
        [Date] &amp;lt;&amp;gt; tbl[Begin]
            &amp;amp;&amp;amp; [Date] &amp;lt;&amp;gt; tbl[End]
    )
VAR _calendar =
    ADDCOLUMNS (
        'Calendar',
        "count", COUNTX ( FILTER ( _fact, [Date] = EARLIER ( 'Calendar'[Date] ) ), [Date] )
    )
RETURN
    SUMX ( _calendar, [count] )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 16:13:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-days-in-between-two-dates-for-each-year/m-p/2263807#M54796</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2022-01-03T16:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate days in between two dates for each year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-days-in-between-two-dates-for-each-year/m-p/2263921#M54803</link>
      <description>&lt;P&gt;Using GENERATE on a fact table seems like a bad idea from a performance perspective. Your _fact variable could potentially be quite an enormous table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd recommend something simpler like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DATEDIFF (
    MAX ( MIN ( tbl[Begin] ), MIN ( 'Calendar'[Date] ) ),
    MIN ( MAX ( tbl[End]   ), MAX ( 'Calendar'[Date] ) ),
    DAY
)
&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 03 Jan 2022 17:30:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-days-in-between-two-dates-for-each-year/m-p/2263921#M54803</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2022-01-03T17:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate days in between two dates for each year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-days-in-between-two-dates-for-each-year/m-p/2263926#M54804</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":clapping_hands:"&gt;👏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 17:33:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-days-in-between-two-dates-for-each-year/m-p/2263926#M54804</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2022-01-03T17:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate days in between two dates for each year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-days-in-between-two-dates-for-each-year/m-p/2263952#M54807</link>
      <description>&lt;P&gt;Thank you &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24978" data-lia-user-login="smpa01" class="lia-mention lia-mention-user"&gt;smpa01&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 17:57:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-days-in-between-two-dates-for-each-year/m-p/2263952#M54807</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-03T17:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate days in between two dates for each year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-days-in-between-two-dates-for-each-year/m-p/2263954#M54808</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 17:58:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-days-in-between-two-dates-for-each-year/m-p/2263954#M54808</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-03T17:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate days in between two dates for each year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-days-in-between-two-dates-for-each-year/m-p/2269850#M55211</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The measure is perfect in a diagram but when a switch the same measure in a table or matrix an error occurred:&lt;/SPAN&gt;&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;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can anyone help me with this issue?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 16:14:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-days-in-between-two-dates-for-each-year/m-p/2269850#M55211</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-06T16:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate days in between two dates for each year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-days-in-between-two-dates-for-each-year/m-p/2269851#M55212</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The measure is perfect in a diagram but when a switch the same measure in a table or matrix an error occurred:&lt;/SPAN&gt;&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;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can anyone help me with this issue?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 16:14:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-days-in-between-two-dates-for-each-year/m-p/2269851#M55212</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-06T16:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate days in between two dates for each year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-days-in-between-two-dates-for-each-year/m-p/2269958#M55220</link>
      <description>&lt;P&gt;Please post the full DAX code you're using for this measure. I can't think of a way the DAX I suggested would give this error, so I'm assuming there are some extra bits.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 16:57:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-days-in-between-two-dates-for-each-year/m-p/2269958#M55220</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2022-01-06T16:57:00Z</dc:date>
    </item>
  </channel>
</rss>

