Forum Discussion

Jc_16's avatar
Jc_16
Frequent Visitor
3 years ago
Solved

How to distribut days

I'm working in a hotel and I need to distribut and sum the number of night on each Monty. For example, a client stay since 28/12/2022 to 03/01/2023, (3 nights in december and 3 nights in January) N...
  • Lennard's avatar
    3 years ago

    Hey there,

     

    I guess your data table looks similar to this: 

    GuestArrivalDeparture
    A27.12.202205.01.2023
    B30.11.202201.12.2022

     

    ?

     

    Then try:

     

    Calendartable: 

     

    Crossjoin:

    virtable = filter(CROSSJOIN(cal,'Table'),'Table'[Arrival]<=cal[Date] && 'Table'[Departure] > cal[Date])
     

    Best regards