Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Ocupation table

Hi!   I have a table with reservations. I have check in date and number of nights.   I want to create a visual with the ocupation each day in the hotel, for example a bar chart. To get this i wan...
  • PattemManohar's avatar
    PattemManohar
    7 years ago

    Anonymous  Please try this as a New Table to achieve your desired output i.e. Output 2 as mentioned above.

     

    Test304Out = 
    VAR _Date = SELECTCOLUMNS(GENERATE(CALENDAR(MIN(Test304RowSplit[CheckIn]),MAX(Test304RowSplit[CheckIn])),Test304RowSplit),"Date",[Date],"ID",[ID],"CheckOut",Test304RowSplit[CheckIn]+(Test304RowSplit[Nights]-1),"ExcludeFlag",IF([Date]>=Test304RowSplit[CheckIn] && [Date]<=Test304RowSplit[CheckIn]+(Test304RowSplit[Nights]-1),"N","Y"))
    RETURN SELECTCOLUMNS(FILTER(_Date,[ExcludeFlag]="N"),"Date",[Date],"ID",[ID])