<?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 Occupancy Rate Formula in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3721850#M144940</link>
    <description>&lt;P&gt;Hi guys,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to calculate the occupancy rate for all properties that we manage.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So now I am using this formula that returns me a precise result for one property:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Occupancy Rate =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[Total Rented Days]&lt;/SPAN&gt;&lt;SPAN&gt; / (&lt;/SPAN&gt;&lt;SPAN&gt;365&lt;/SPAN&gt;&lt;SPAN&gt; - &lt;/SPAN&gt;&lt;SPAN&gt;[Total Blocked Dates]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;So this works well when one property is selected except of course when there is a leap year, but the difference is negligible.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;What I want is to have the right occupation rate when I select more than one property from the slicer or when I dont have any selection and it aggregates the measures from all properties and that 365 remains constant.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Xanthos&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Sun, 25 Feb 2024 12:00:32 GMT</pubDate>
    <dc:creator>Samhunt</dc:creator>
    <dc:date>2024-02-25T12:00:32Z</dc:date>
    <item>
      <title>Occupancy Rate Formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3721850#M144940</link>
      <description>&lt;P&gt;Hi guys,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to calculate the occupancy rate for all properties that we manage.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So now I am using this formula that returns me a precise result for one property:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Occupancy Rate =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[Total Rented Days]&lt;/SPAN&gt;&lt;SPAN&gt; / (&lt;/SPAN&gt;&lt;SPAN&gt;365&lt;/SPAN&gt;&lt;SPAN&gt; - &lt;/SPAN&gt;&lt;SPAN&gt;[Total Blocked Dates]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;So this works well when one property is selected except of course when there is a leap year, but the difference is negligible.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;What I want is to have the right occupation rate when I select more than one property from the slicer or when I dont have any selection and it aggregates the measures from all properties and that 365 remains constant.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Xanthos&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 25 Feb 2024 12:00:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3721850#M144940</guid>
      <dc:creator>Samhunt</dc:creator>
      <dc:date>2024-02-25T12:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Occupancy Rate Formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3722060#M144951</link>
      <description>&lt;P&gt;Use a proper calendar table so you can use the actual days in a year (including THIS year!).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Feb 2024 16:32:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3722060#M144951</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-25T16:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Occupancy Rate Formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3726446#M145157</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="655285" data-lia-user-login="Samhunt" class="lia-mention lia-mention-user"&gt;Samhunt&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following expressions are for your reference:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = IF(ISFILTERED(your slicer),[Total Rented Days] / (365 - [Total Blocked Dates]),[Total Rented Days]/365)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope it helps!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Community Support Team_ Scott Chang&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 07:19:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3726446#M145157</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-27T07:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Occupancy Rate Formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3734156#M145540</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please use the link below to find something similar to what I am using in my project.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://drive.google.com/file/d/11-KXMj9XfPwSAe9gnZj_NZWsLPLfaX9Z/view?usp=drive_link" target="_blank"&gt;https://drive.google.com/file/d/11-KXMj9XfPwSAe9gnZj_NZWsLPLfaX9Z/view?usp=drive_link&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Looking forward for your reply&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Xanthos&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 16:30:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3734156#M145540</guid>
      <dc:creator>Samhunt</dc:creator>
      <dc:date>2024-02-29T16:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Occupancy Rate Formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3737330#M145690</link>
      <description>&lt;P&gt;Link asks for access. Please check.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Mar 2024 02:50:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3737330#M145690</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-02T02:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Occupancy Rate Formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3737415#M145700</link>
      <description>&lt;P&gt;Apologies &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now it should be ok&lt;/P&gt;</description>
      <pubDate>Sat, 02 Mar 2024 06:04:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3737415#M145700</guid>
      <dc:creator>Samhunt</dc:creator>
      <dc:date>2024-03-02T06:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Occupancy Rate Formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3737795#M145722</link>
      <description>&lt;P&gt;Your Blocked Dates table has blanks, as has your Booking table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you considered using From/To intervals or are you ok with listing individual days for each booking?&amp;nbsp; (both are ok, just asking)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no booking ID anywhere?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most of your date columns are still marked as text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Mar 2024 18:54:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3737795#M145722</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-02T18:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Occupancy Rate Formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3738184#M145737</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am an amature so I try to find the solutions to what I want to create through the forum and videos so I simply blindly follow people's suggestions &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have used this video which it made sense how to set it up according to my limited understanding of how Dax works:&amp;nbsp;&lt;A href="https://www.youtube.com/watch?v=ISDhR-TzwJk&amp;amp;t=1s" target="_blank" rel="noopener"&gt;https://www.youtube.com/watch?v=ISDhR-TzwJk&amp;amp;t=1s&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe this way it will eventually overload my data model.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I am up for suggestions,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Booking ID's are on a different table that shows our revenue. So I count the number of bookings from that one.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards&lt;/P&gt;</description>
      <pubDate>Sun, 03 Mar 2024 10:53:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3738184#M145737</guid>
      <dc:creator>Samhunt</dc:creator>
      <dc:date>2024-03-03T10:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Occupancy Rate Formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3738369#M145745</link>
      <description>&lt;P&gt;take a deep breath, and start learning the basics of data models and data types.&amp;nbsp; Blindly following other people's suggestions only gets you so far.&lt;/P&gt;</description>
      <pubDate>Sun, 03 Mar 2024 16:43:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3738369#M145745</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-03T16:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: Occupancy Rate Formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3738407#M145748</link>
      <description>&lt;P&gt;Solution to the problem&lt;BR /&gt;&lt;BR /&gt;Use the following formula to count the number of selected options in the slicer.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Also check this video:&amp;nbsp;&amp;nbsp;&lt;A href="https://www.youtube.com/watch?v=D532_ix9qLQ" target="_blank"&gt;https://www.youtube.com/watch?v=D532_ix9qLQ&lt;/A&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Count Selected Properties =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;'Properties'&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;[Accommodation&lt;/STRONG&gt;]&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;BR /&gt;Replace the red bold text with the field you added in your slicer. So this will count how many options you have selected and if there is no option selected will count all the number of options in the slicer.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Then add this in your occupancy formula to multiply it with the number of days.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This is my formula because we manage properties that we allow owners to block dates for their own use of the property and we want to remove those days from the total days that the property was available.&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN&gt;Occupancy Rate =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[Total Rented Days]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;/ ( (&lt;/SPAN&gt;&lt;SPAN&gt;365*&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;[Count Selected Properties])-&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;[Total Blocked Dates]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;This will return you the right result. It will be off by one day for leap years personally but for me that is negligible.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 03 Mar 2024 18:17:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Occupancy-Rate-Formula/m-p/3738407#M145748</guid>
      <dc:creator>Samhunt</dc:creator>
      <dc:date>2024-03-03T18:17:29Z</dc:date>
    </item>
  </channel>
</rss>

