Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
faelchristofano
Frequent Visitor

Count Day for ocuppation rate

I need to create on dashboard para show the ocuppation rate in the bedrooms of one hotel.

The table have the follow columns:

Date of check-in - Date of check-out - Amount days

For example, one guest arrive 06/25/2019 and go out 07/10/2019, logo he stayed 15 days.

In dashboard I have one Slicer for my table calendar and if the user to filter for 06/01/2019 until 06/30/2019, the example to up, has to return 10 days.

And, if the filter is for a longer period, for example 06/01/2019 until 07/31/2019, has to return only 15 days.

 

So, before sum the days, I need compare if(max(calendar[date] < Date of check-out)

 

How to make this?

1 REPLY 1
Cmcmahan
Resident Rockstar
Resident Rockstar

You should just be able to just use something like this without doing any comparisons to count the days.

Occupancy = SUMX('table', COUNTROWS(DATESBETWEEN('calendar'[date], 'table'[Date of check-in], 'table'[Date of check-out])))

  

If you could share a set of sample data/expected outputs, that would be very helpful in getting you a more accurate answer.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors