<?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: How to calculate the occupancy of the hotel by room category from the certain chosen year and month in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3188364#M115526</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="254615" data-lia-user-login="v-jingzhang" class="lia-mention lia-mention-user"&gt;v-jingzhang&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you for your dedication in solving the asked task. This year details and last year details are all matching, however same time last year is not . For same time last year - if you filter manually in the excel , where you filter the booked date from the start till 13/04/&lt;STRONG&gt;2022&lt;/STRONG&gt;, for the stay period of ( lets say) April &lt;STRONG&gt;2022&lt;/STRONG&gt;&amp;nbsp;, it should be 3713 - the same has to felect in the report where i am able to see that the report shows 2687.&lt;BR /&gt;&lt;BR /&gt;will you again help me here please .&lt;/P&gt;</description>
    <pubDate>Fri, 14 Apr 2023 11:04:30 GMT</pubDate>
    <dc:creator>XYZHotel</dc:creator>
    <dc:date>2023-04-14T11:04:30Z</dc:date>
    <item>
      <title>How to calculate the occupancy of the hotel by room category from the certain chosen year and month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3178834#M114868</link>
      <description>&lt;P&gt;&amp;nbsp;My hotel has 8 different room types and each room type has its own total inventory which is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Room A has a total of 20 units per day inventory.&lt;/P&gt;&lt;P&gt;Room b has a total of 33 units per day inventory.&lt;/P&gt;&lt;P&gt;Room c has a total of 62 units per day inventory.&lt;/P&gt;&lt;P&gt;Room d has a total of 84 units per day inventory.&lt;/P&gt;&lt;P&gt;Room e has total of 21 units per day inventory.&lt;/P&gt;&lt;P&gt;Room f has a total of 16 units per day inventory.&lt;/P&gt;&lt;P&gt;Room g has a total of 3 units per day inventory.&lt;/P&gt;&lt;P&gt;Room h has a total of 1 unit per day inventory’.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Total Inventory of the hotel per day is 180 in together.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lets assume that the total sold room for January 2023 is 3710 where the room nights were shared from the below room types as ,&lt;/P&gt;&lt;P&gt;Room a is sold with total of 468&lt;/P&gt;&lt;P&gt;Room b is sold with total of 568&lt;/P&gt;&lt;P&gt;Room c is sold with total of 768&lt;/P&gt;&lt;P&gt;Room d is sold with total of 568&lt;/P&gt;&lt;P&gt;Room e is sold with total of 968&lt;/P&gt;&lt;P&gt;Room f is sold with total of 168&lt;/P&gt;&lt;P&gt;Room g is sold with total of 184&lt;/P&gt;&lt;P&gt;Room h is sold with total of 18&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lets assume that the total sold room for February 2023 is 3410 where the room nights were shared from the below room types as ,&lt;/P&gt;&lt;P&gt;Room a is sold with total of 168&lt;/P&gt;&lt;P&gt;Room b is sold with total of 568&lt;/P&gt;&lt;P&gt;Room c is sold with total of 768&lt;/P&gt;&lt;P&gt;Room d is sold with total of 568&lt;/P&gt;&lt;P&gt;Room e is sold with total of 968&lt;/P&gt;&lt;P&gt;Room f is sold with total of 168&lt;/P&gt;&lt;P&gt;Room g is sold with total of 184&lt;/P&gt;&lt;P&gt;Room h is sold with total of 18&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now When I filter to get the result, I would bring year, month and room type as row column and total nights booked in the column1. Now in column two I want to get the occupancy report for the booked room nights from the total available to sell which is 180 per day. Same time there is a criteria that when you see the total as row by year it would show you by year with the expanded month &amp;nbsp;, it would give you the total room nights occupied by the room night to be sold without any filter ( this is most obvious result everyone could get ) for that particular month ( based on the total room inventory available ). Now when the month is expanded by the room type, the occupancy should be calculated by the breakdown of the room nights occupied by the room types with their inventory ; which is if room A has a total unit of 20 units per day, for a month ( assuming January) &amp;nbsp;it would have 620 units , now when the month for January is expanded to view the room type production , then the occupancy per room type should be given or shown as per their inventory and not the total unit which is 180.&lt;BR /&gt;&lt;BR /&gt;for January , Room A was sold with 468 , the occupancy should be calculated as 468/620*100 = 75.48 and same way to other room types.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please helm me here.&lt;/P&gt;</description>
      <pubDate>Sun, 09 Apr 2023 11:54:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3178834#M114868</guid>
      <dc:creator>XYZHotel</dc:creator>
      <dc:date>2023-04-09T11:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the occupancy of the hotel by room category from the certain chosen year and month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3178855#M114870</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="543316" data-lia-user-login="XYZHotel" class="lia-mention lia-mention-user"&gt;XYZHotel&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it would be easier if you could depict your case with data tables.&lt;/P&gt;</description>
      <pubDate>Sun, 09 Apr 2023 13:03:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3178855#M114870</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-04-09T13:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the occupancy of the hotel by room category from the certain chosen year and month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3178863#M114871</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;the excel file is in this link&amp;nbsp;&lt;A href="https://filetransfer.io/data-package/hyn7sBiY#link" target="_blank" rel="noopener"&gt;https://filetransfer.io/data-package/hyn7sBiY#link&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;Below the table SC,&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;Here BBG is A and so on respectively&lt;/P&gt;&lt;P&gt;I wanted to&amp;nbsp; have the occupancy based on the year and month selected from the total available inventory ( you may see the room numbers available unit in the excel ) , and while it shows the total in year - it should have it automatic calculated with number of days in the year which is 365 * number of units to be sold for the room night booked.&lt;BR /&gt;&lt;BR /&gt;In the row total of month, it should calculated by no of days in the month for that particular year choosen&amp;nbsp;&lt;BR /&gt;and in the room typoes, it whould calculate, number of room booked / total unit room avaiilable for the month ( 180*31) and so on for other rooms types as well.&lt;/P&gt;</description>
      <pubDate>Sun, 09 Apr 2023 13:34:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3178863#M114871</guid>
      <dc:creator>XYZHotel</dc:creator>
      <dc:date>2023-04-09T13:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the occupancy of the hotel by room category from the certain chosen year and month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3179929#M114926</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;&amp;nbsp; , checking weather you are able to help here ?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 13:24:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3179929#M114926</guid>
      <dc:creator>XYZHotel</dc:creator>
      <dc:date>2023-04-10T13:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the occupancy of the hotel by room category from the certain chosen year and month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3183259#M115144</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="543316" data-lia-user-login="XYZHotel" class="lia-mention lia-mention-user"&gt;XYZHotel&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can add a Date table with below DAX and build relationships between tables like the image.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Date = ADDCOLUMNS(CALENDARAUTO(),"Year",YEAR([Date]),"Month",FORMAT([Date],"mmm"),"MonthNumber",MONTH([Date]),"YearMonth",YEAR([Date])*100+MONTH([Date]))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then create measures:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Booked RMs = SUM(TestingDatasheet[Rooms Booked])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Total RMs = SUM(RoomDetails[Number of Rooms in Category])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Occ% = DIVIDE([Booked RMs], COUNT('Date'[Date]) * [Total RMs])&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;
&lt;P&gt;I have attached a sample file at bottom for your reference.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Jing&lt;BR /&gt;If this post helps, please Accept it as Solution to help other members find it.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 06:04:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3183259#M115144</guid>
      <dc:creator>v-jingzhang</dc:creator>
      <dc:date>2023-04-12T06:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the occupancy of the hotel by room category from the certain chosen year and month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3183272#M115147</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="543316" data-lia-user-login="XYZHotel" class="lia-mention lia-mention-user"&gt;XYZHotel&lt;/a&gt;&amp;nbsp;, here is the sample pbix file.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 06:12:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3183272#M115147</guid>
      <dc:creator>v-jingzhang</dc:creator>
      <dc:date>2023-04-12T06:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the occupancy of the hotel by room category from the certain chosen year and month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3184125#M115218</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="254615" data-lia-user-login="v-jingzhang" class="lia-mention lia-mention-user"&gt;v-jingzhang&lt;/a&gt;&amp;nbsp;, this is really helpful , also if you could help me in getting a same time last year details. Here same time last year is not the total rooms that i had back in samedate last year based on on the stay date, but i need to have it based on the booking date. For Example , if today is 12/04/2023 - same time last year based on the stay period will be total rooms till 12/04/2023 , i would need that as well but also would need to know what was my total room nights based on the booking date which is from the start of the business till 12/04/2022 for any given /selected period of date ? and this should show in in the same column of theyear such as when you are looking at 2023, jan , the above asked question should be shown together - i tried to do this but it gives me some odd numbers when it breakdowns in to room types ;&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;&lt;BR /&gt;&lt;BR /&gt;pls help me here&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 13:34:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3184125#M115218</guid>
      <dc:creator>XYZHotel</dc:creator>
      <dc:date>2023-04-12T13:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the occupancy of the hotel by room category from the certain chosen year and month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3185557#M115305</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="543316" data-lia-user-login="XYZHotel" class="lia-mention lia-mention-user"&gt;XYZHotel&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry I don't understand the new requirement well. Can you give a more detailed example that how a result should be calculated for a room type/month/year? And the current matrix only has the&amp;nbsp;granularity to month, so for any selected date how should it be calculated? Or perhaps you will always calculate the result based on the moving "today"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In an example, can you show how to calculate the result for BBG in January 2023 when today is 13/04/2023? And what is the specific result based on the current sample data?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 07:02:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3185557#M115305</guid>
      <dc:creator>v-jingzhang</dc:creator>
      <dc:date>2023-04-13T07:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the occupancy of the hotel by room category from the certain chosen year and month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3185601#M115308</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="254615" data-lia-user-login="v-jingzhang" class="lia-mention lia-mention-user"&gt;v-jingzhang&lt;/a&gt;&amp;nbsp;- sorry for being not clear .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as in the sheet you have two seperate column with one Booked Date and one Stay Date. In your example , you have a measure where i could see total rooms for this year and with room type . now i want another result where in the same line which should same time last year overall with the room types room booked , where the function Sameperiodlastyear can be used . This result wiull give you based on the stay date ( since stay date is the main date to be measured). This is also okay. ( y ou can see the result in my earlier provided screenshot as in column "LY-RM"&lt;BR /&gt;I also want a third coulum which would measure the rooms that was booked by same period last year ( based on the booked date) resulting for the same month and date last year by stay date.&lt;BR /&gt;Exaample from 2017-01-01 till today date the you will see total of 170210 rooms booked&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Please note that this data is filtered by stay date.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Now if i want to have a result what was booked last year same time but filtered by booked date and not stay date . from 2017-01-01 till 2023-04-13 should be the &lt;STRONG&gt;booked date&lt;/STRONG&gt; filter and &lt;STRONG&gt;stay date&lt;/STRONG&gt; should be from 2017-01-01 till date . When in result it should show as&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;in this screenshot ,&lt;BR /&gt;-the first column in for this year what we had,&lt;BR /&gt;-second column what we had last year&lt;BR /&gt;- and third coulmn what we have same time last year filterd on the booking date&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 07:19:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3185601#M115308</guid>
      <dc:creator>XYZHotel</dc:creator>
      <dc:date>2023-04-13T07:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the occupancy of the hotel by room category from the certain chosen year and month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3187775#M115485</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="543316" data-lia-user-login="XYZHotel" class="lia-mention lia-mention-user"&gt;XYZHotel&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please check the new pbix file attached at bottom. Notice that I add an inactive relationship between 'Date'[Date] and 'TestingDatasheet'[Booked Date] and use USERELATIONSHIP function in two measures.&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;Best Regards,&lt;BR /&gt;Community Support Team _ Jing&lt;BR /&gt;If this post helps, please Accept it as Solution to help other members find it.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 06:40:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3187775#M115485</guid>
      <dc:creator>v-jingzhang</dc:creator>
      <dc:date>2023-04-14T06:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the occupancy of the hotel by room category from the certain chosen year and month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3188364#M115526</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="254615" data-lia-user-login="v-jingzhang" class="lia-mention lia-mention-user"&gt;v-jingzhang&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you for your dedication in solving the asked task. This year details and last year details are all matching, however same time last year is not . For same time last year - if you filter manually in the excel , where you filter the booked date from the start till 13/04/&lt;STRONG&gt;2022&lt;/STRONG&gt;, for the stay period of ( lets say) April &lt;STRONG&gt;2022&lt;/STRONG&gt;&amp;nbsp;, it should be 3713 - the same has to felect in the report where i am able to see that the report shows 2687.&lt;BR /&gt;&lt;BR /&gt;will you again help me here please .&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 11:04:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-occupancy-of-the-hotel-by-room-category/m-p/3188364#M115526</guid>
      <dc:creator>XYZHotel</dc:creator>
      <dc:date>2023-04-14T11:04:30Z</dc:date>
    </item>
  </channel>
</rss>

