Forum Discussion
ShamR9T
3 years agoFrequent Visitor
Calculate Monthly Occupancy based on Checkin Checkout dates
I have a problem I want to solve. I have a main table which is the reservations and has details of the guest. it has details like nationality, checkin date, biographical date etc. this also means tha...
- 3 years ago
Jihwan_Kim
3 years agoSuper User
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
Room nights measure: =
VAR _newtable =
GENERATE (
Data,
FILTER (
DISTINCT ( 'Calendar'[Date] ),
'Calendar'[Date] >= Data[Checkin]
&& 'Calendar'[Date] <= Data[Checkout]
)
)
RETURN
COUNTROWS ( _newtable )
ShamR9T
3 years agoFrequent Visitor
Sorry. Just to also add. I dont think this solution is accounting for guests that checked in prior to the beginning of the period either. so for example someone who checked in on December 31st and checked out on February 2nd isnt accounted for in January.