<?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: Days in Current Month in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-in-Current-Month/m-p/1218385#M19720</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;The above solution looks correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However you can try,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create a Calculated Column in your Date Table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YearMonthnumber = FORMAT ( Dates[Date],"YYYYM")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then create a measure&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Days in current Month =
VAR _month =
    MONTH (
        TODAY ()
    )
VAR _year =
    YEAR (
        TODAY ()
    )
RETURN
    COUNTROWS (
        FILTER (
            ALL ( Dates ),
            Dates[YearMonthnumber]
                = CONCATENATE (
                    _year,
                    _month
                )
        )
    )&lt;/LI-CODE&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;/P&gt;&lt;P&gt;Harsh Nathani&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jul 2020 12:00:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-07-13T12:00:21Z</dc:date>
    <item>
      <title>Days in Current Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-in-Current-Month/m-p/1214980#M19604</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to return the number of days in July and I used the measure below measure. It returns 30 days instead of 31 days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Days_In_Current_Month = DAY(ENDOFMONTH('Date'[Date]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 10 Jul 2020 14:33:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-in-Current-Month/m-p/1214980#M19604</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-10T14:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Days in Current Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-in-Current-Month/m-p/1215064#M19605</link>
      <description>&lt;P&gt;If you meant currently selected month then you can use&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Days in current month =
COUNTROWS ( VALUES ( Dates[Date] ) )&lt;/LI-CODE&gt;&lt;P&gt;or&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Days in current month = DISTINCTCOUNT( Dates[Date] )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;if you meant in July 2020 then&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Days in current month =
COUNTROWS (
    FILTER (
        Dates,
        Dates[Month Number] = MONTH ( TODAY () )
            &amp;amp;&amp;amp; Dates[Calendar Year Number] = YEAR ( TODAY () )
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 10 Jul 2020 15:03:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-in-Current-Month/m-p/1215064#M19605</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-07-10T15:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: Days in Current Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-in-Current-Month/m-p/1215151#M19609</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Days_In_Current_Month = DAY(EOMONTH('Date'[Date],0))&lt;BR /&gt;&lt;BR /&gt;if it is a measure&lt;BR /&gt;Days_In_Current_Month = DAY(today(),0))&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 15:39:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-in-Current-Month/m-p/1215151#M19609</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-07-10T15:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Days in Current Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-in-Current-Month/m-p/1218243#M19711</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="236628" data-lia-user-login="AntrikshSharma" class="lia-mention lia-mention-user"&gt;AntrikshSharma&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for a measure that will return the number of days in any current month. July is now the current month so it should return 31 days, Next month is August , when we enter August it shoukd return 31 day as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried your suggestions, measure number 3 returned blank days. please explain what the year number is suppose to stand for , as i dont have that in my date table.&lt;/P&gt;&lt;P&gt;A snip of my date table below and also the measure below.&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;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 11:08:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-in-Current-Month/m-p/1218243#M19711</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-13T11:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Days in Current Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-in-Current-Month/m-p/1218261#M19712</link>
      <description>Calendar year number is just year like 2020, 2019 etc do you have the dates for 2020 in your table?</description>
      <pubDate>Mon, 13 Jul 2020 11:14:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-in-Current-Month/m-p/1218261#M19712</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-07-13T11:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Days in Current Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-in-Current-Month/m-p/1218303#M19716</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="236628" data-lia-user-login="AntrikshSharma" class="lia-mention lia-mention-user"&gt;AntrikshSharma&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;yes i do.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 11:30:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-in-Current-Month/m-p/1218303#M19716</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-13T11:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Days in Current Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-in-Current-Month/m-p/1218385#M19720</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above solution looks correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However you can try,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create a Calculated Column in your Date Table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YearMonthnumber = FORMAT ( Dates[Date],"YYYYM")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then create a measure&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Days in current Month =
VAR _month =
    MONTH (
        TODAY ()
    )
VAR _year =
    YEAR (
        TODAY ()
    )
RETURN
    COUNTROWS (
        FILTER (
            ALL ( Dates ),
            Dates[YearMonthnumber]
                = CONCATENATE (
                    _year,
                    _month
                )
        )
    )&lt;/LI-CODE&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;/P&gt;&lt;P&gt;Harsh Nathani&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 12:00:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-in-Current-Month/m-p/1218385#M19720</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-13T12:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Days in Current Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-in-Current-Month/m-p/1218676#M19739</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this worked correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 14:21:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-in-Current-Month/m-p/1218676#M19739</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-13T14:21:58Z</dc:date>
    </item>
  </channel>
</rss>

