<?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: DAYS360 in Quick Measures Gallery</title>
    <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAYS360/m-p/2494282#M844</link>
    <description>&lt;P&gt;&lt;SPAN class=""&gt;Hi,&amp;nbsp;&lt;A class="" href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/313" target="_blank" rel="noopener"&gt;&lt;SPAN class=""&gt;Greg_Deckler!&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/A&gt;You, sir, are a lifesaver!&amp;nbsp; Been pounding my head on a wall for weeks on this one.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;Thank you!&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 04 May 2022 19:44:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-05-04T19:44:08Z</dc:date>
    <item>
      <title>DAYS360</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAYS360/m-p/1062952#M475</link>
      <description>&lt;P&gt;&lt;A title="" href="https://community.powerbi.com/t5/Community-Blog/Excel-to-DAX-Translation/ba-p/1060991" target="_self"&gt;In my recent quest to create or catalog as many DAX equivalents for Excel functions&lt;/A&gt;&lt;SPAN&gt;, this one is for all the accountants out there that are so stodgy, old fashioned and resistant to change that they refuse to use any other calendar than the one used by the Babylonians and Mayans...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DAYS360 = 
    VAR __Date1 = MAX([Date1])
    VAR __Date2 = MAX([Date2])
    VAR __CalendarBase =
        FILTER(
            CALENDAR(__Date1,__Date2),
            DAY([Date]) &amp;lt;= 30
        )
    VAR __FebCal =
        SUMMARIZE(
            ADDCOLUMNS(
                FILTER(
                    __CalendarBase,
                    MONTH([Date]) = 2 &amp;amp;&amp;amp; (DAY([Date]) = 28 || DAY([Date]) = 29) ||
                        MONTH([Date]) = 3 &amp;amp;&amp;amp; DAY([Date]) = 1
                ),
                "Year",YEAR([Date])
            ),
            [Year],
            "FebExtraDays",
                VAR __Year = [Year]
                VAR __Div4 = IF(MOD(__Year,4)=0,TRUE(),FALSE())
                VAR __Div100 = IF(MOD(__Year,100)=0,TRUE(),FALSE())
                VAR __Div400 = IF(MOD(__Year,400)=0,TRUE(),FALSE())
                VAR __IsLeapYear = IF(__Div4 &amp;amp;&amp;amp; NOT(__Div100),TRUE(),IF(__Div4 &amp;amp;&amp;amp; __Div100 &amp;amp;&amp;amp; __Div400,TRUE(),FALSE()))
            RETURN IF(__IsLeapYear,1,2)
        )
    VAR __Adjustment = IF(DAY(__Date1)&amp;gt;30 || DAY(__Date2)&amp;gt;30,0,-1)
RETURN
   COUNTROWS(__CalendarBase) + SUMX(__FebCal,[FebExtraDays]) + __Adjustment&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="reportid hidden"&gt;eyJrIjoiYzEzNzZiYjQtMGY2Ni00N2U1LWJjYjQtNDcwOTYwZjk1M2U4IiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN9&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 10 May 2020 23:06:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAYS360/m-p/1062952#M475</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-05-10T23:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: DAYS360</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAYS360/m-p/2494282#M844</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;Hi,&amp;nbsp;&lt;A class="" href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/313" target="_blank" rel="noopener"&gt;&lt;SPAN class=""&gt;Greg_Deckler!&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/A&gt;You, sir, are a lifesaver!&amp;nbsp; Been pounding my head on a wall for weeks on this one.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;Thank you!&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 19:44:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAYS360/m-p/2494282#M844</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-04T19:44:08Z</dc:date>
    </item>
  </channel>
</rss>

