<?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: DAX to get number of nights per month between 2 dates in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-get-number-of-nights-per-month-between-2-dates/m-p/3633528#M140535</link>
    <description>&lt;P&gt;I think it works, but before I marked it as a solution, I need to know if this will work with other visuals, for example a line chart, or to create other measures with it&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jan 2024 14:16:30 GMT</pubDate>
    <dc:creator>manup07</dc:creator>
    <dc:date>2024-01-11T14:16:30Z</dc:date>
    <item>
      <title>DAX to get number of nights per month between 2 dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-get-number-of-nights-per-month-between-2-dates/m-p/3631791#M140474</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;CONTEXT:&lt;/STRONG&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I have a table with different room transactions(reservations), I'm trying to calculate the number of nights between two dates so I can usem them in a pivot table or any graph, like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This result is not correct because I should have in december(diciembre) 8 instead of 9 and that 1 remaning should go to january, and so on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;QUESTION:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;How to create a DAX or how to solve this issue.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 02:41:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-get-number-of-nights-per-month-between-2-dates/m-p/3631791#M140474</guid>
      <dc:creator>manup07</dc:creator>
      <dc:date>2024-01-11T02:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to get number of nights per month between 2 dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-get-number-of-nights-per-month-between-2-dates/m-p/3632030#M140483</link>
      <description>&lt;P&gt;Hi, I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file whether it suits your requirement.&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;&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;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;expected result measure: =
VAR _currentmonth =
    MAX ( 'Calendar'[Year-Month sort] )
VAR _t =
    GENERATE (
        Data,
        FILTER (
            'Calendar',
            'Calendar'[Date] &amp;gt; Data[Start]
                &amp;amp;&amp;amp; 'Calendar'[Date] &amp;lt;= Data[End]
        )
    )
RETURN
    COUNTROWS ( FILTER ( _t, 'Calendar'[Year-Month sort] = _currentmonth ) )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 04:18:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-get-number-of-nights-per-month-between-2-dates/m-p/3632030#M140483</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-01-11T04:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to get number of nights per month between 2 dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-get-number-of-nights-per-month-between-2-dates/m-p/3633528#M140535</link>
      <description>&lt;P&gt;I think it works, but before I marked it as a solution, I need to know if this will work with other visuals, for example a line chart, or to create other measures with it&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 14:16:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-get-number-of-nights-per-month-between-2-dates/m-p/3633528#M140535</guid>
      <dc:creator>manup07</dc:creator>
      <dc:date>2024-01-11T14:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to get number of nights per month between 2 dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-get-number-of-nights-per-month-between-2-dates/m-p/3633954#M140566</link>
      <description>&lt;P&gt;Hi, thank you for your message, and please provide your sample pbix file and then I can try to look into it.&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 17:47:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-get-number-of-nights-per-month-between-2-dates/m-p/3633954#M140566</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-01-11T17:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to get number of nights per month between 2 dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-get-number-of-nights-per-month-between-2-dates/m-p/3635959#M140660</link>
      <description>&lt;P&gt;No worries, your answer work wonders, thank you so much&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2024 13:37:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-get-number-of-nights-per-month-between-2-dates/m-p/3635959#M140660</guid>
      <dc:creator>manup07</dc:creator>
      <dc:date>2024-01-12T13:37:02Z</dc:date>
    </item>
  </channel>
</rss>

