Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Condo/ Property Availability

I'm apologizing in advance as I'm well aware that this topic has been covered many times before. Though in all honesty, not exactly in the way that I am needing. It seems that when figuring Occupancy, depending on the user this can differ greatly. So, rather than look for the Occupancy percentage, I would like to find the availability. Also, not focusing so much on what is available for each day but what property is available for a select number of days. For instance, looking at my reservation report I would like to know how many and which properties are open starting on 5/3/2018 for a 4-night stay or 6/2/2018 for 10 nights. 

 

Every reservation has a unique Reservation ID through a Unit ID can be on multiple reservations. This report has a relationship to the Unit List established through the Unit ID. I've included a dummy version of my reservation report.

 

I've included a dummy version of my reservation report. I also have a Unit List that has a unique unit ID as well as relevant information for each property. No duplicates. However, some units are active and some are no longer active in our system and this shows in a "status" column.

 

My problem when trying to use some of the other solutions varies. Mainly, due to the fact that I may try to compare available rooms to This Day Last Year, or I want what open from May 3, 2018, for 3 nights and not May 3, 2016, 2017, etc...  to Sum it up, If someone were to call looking for a property to rent, I want to be able to see a distinct count and list of property names of what I have available for any given date range or "between dates" slicer.

 

I truly appreciate any assistance. I've decided to start this over from scratch in hopes of figuring this out. Thanks

 

   Reservation Report         
              
Reservation IDPropertyRentCheck InCheck out Booking DateAreaTaxFeeTotalStatusSourceRoom IdCustomer Name
1Blue House$500.001/2/20181/9/201811/2/2017City A$335.00$95.00$930.00Checked OutOnline 1 
2Red House $2,500.005/15/20185/22/20181/9/2018City b$421.00$60.00$2,981.00Checked InAgent2 
3Green House$300.005/17/20185/25/20184/5/2018City C$111.00$32.00$443.00Checked InChannel3 
4Yellow Condo$2,300.004/14/20184/21/20181/2/2018City A$156.00$44.00$2,500.00Checked OutOnline 4 
5Black house$400.005/1/20167/5/20164/5/2018City b$219.00$78.00$697.00CancelledAgent5 
6Purple condo$2,400.007/11/20187/18/20195/15/2018City C$355.00$109.00$2,864.00ConfimedChannel6 
7Blue House$1,920.006/2/20186/9/20185/15/2018City A$421.00$222.00$2,563.00ConfirmedOnline 1 
8Red House $2,068.579/5/20189/10/20185/15/2018City b$269.00$42.00$2,379.57ConfirmedAgent2 
9Green House$2,217.142/2/20182/13/20181/2/2018City C$581.00$111.00$2,909.14Checked OutChannel3 
10Gray Room$2,365.714/5/20184/15/20181/2/2018City A$242.00$67.00$2,674.71Checked OutOnline 7 
11Green House$2,514.297/1/20187/12/20184/5/2018City b$301.00$63.00$2,878.29HoldAgent3 

 

 

   Unit List 
IDNameStatus# RoomsType
1Blue HouseActive3House
2Red House Active4Condo
3Green HouseActive5House
4Yellow CondoActive2Condo
5Black houseActive3Condo
6Purple condoActive4Condo
7Gray Roominactive5House
  • Anonymous's avatar
    Anonymous
    8 years ago

    HI Anonymous,

     

    You can refer to below steps if it suitable for your requirement.

     

    Steps:
    1. Create a expand table with detail date from date range of each record.

     

    Expand Table = 
    VAR _calendar =
        CALENDAR ( FIRSTDATE( Reservation[Check In] ), LASTDATE( Reservation[Check out] ) )
    RETURN
        SELECTCOLUMNS (
            FILTER (
                CROSSJOIN ( Reservation, _calendar ),
                [Date] >= [Check In]
                    && [Date] <= [Check out]
            ),
            "Reservation ID", Reservation[Reservation ID],
            "Detail Date", [Date]
        )
    

     

    2. Link original table by 'Reservation ID' column.

     

    3. Write measure to check dynamic status of selection date range.

    Available =
    IF (
        LASTDATE ( ALLSELECTED ( 'Expand Table'[Detail Date] ) )
            IN CALCULATETABLE (
                VALUES ( 'Expand Table'[Detail Date] ),
                ALLSELECTED ( Reservation[Room Id] )
            ),
        "N",
        "Y"
    )
    

    4. Create visuals.

     

    Notice: I attach pbix file below.

     

    Regards,

    Xiaoxin Sheng

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI Anonymous,

     

    You can refer to below steps if it suitable for your requirement.

     

    Steps:
    1. Create a expand table with detail date from date range of each record.

     

    Expand Table = 
    VAR _calendar =
        CALENDAR ( FIRSTDATE( Reservation[Check In] ), LASTDATE( Reservation[Check out] ) )
    RETURN
        SELECTCOLUMNS (
            FILTER (
                CROSSJOIN ( Reservation, _calendar ),
                [Date] >= [Check In]
                    && [Date] <= [Check out]
            ),
            "Reservation ID", Reservation[Reservation ID],
            "Detail Date", [Date]
        )
    

     

    2. Link original table by 'Reservation ID' column.

     

    3. Write measure to check dynamic status of selection date range.

    Available =
    IF (
        LASTDATE ( ALLSELECTED ( 'Expand Table'[Detail Date] ) )
            IN CALCULATETABLE (
                VALUES ( 'Expand Table'[Detail Date] ),
                ALLSELECTED ( Reservation[Room Id] )
            ),
        "N",
        "Y"
    )
    

    4. Create visuals.

     

    Notice: I attach pbix file below.

     

    Regards,

    Xiaoxin Sheng

    • Anonymous's avatar
      Anonymous
      Not applicable

      Anonymous This looks amazing. I'll take a look now to see how his works. I'll let you know shortly!

      • Anonymous's avatar
        Anonymous
        Not applicable

        Anonymous Thank you again. This appears as though it will work for my needs. I do have a question to pose. As my "dummy" reports are very small, creating a "detail date" for each day of a reservation works smoothly. However, my actual report contains nearly 40,000 reservations over the course of 4 years and averages almost 120 new (avg. 6 nights per reservation) reservations daily. Creating a "detail date" for that many reservations may seem very daunting of a task. As we speak I've been waiting 20 minutes with a status of "Working on it" for the Expand Table to complete.

         

        Do you think given the magnitude of my data this is still the best approach? Thanks.