cancel
Showing results for
Did you mean:
Frequent Visitor

## How many guests on a certain day

I have a spreadsheet that lists client check-in and check-out dates. What I'd like to be able to do is report on the number of clients that were staying on a given day.

What's a good way to be able to generate a value (that I could report individually or graph over time) that would report the number of guests we had staying with us on those days?

1 ACCEPTED SOLUTION
Community Support

Hi @petehorsch ,

You can try below formula:

``````mount =
VAR sel =
SELECTEDVALUE ( 'Date'[Date] )
RETURN
CALCULATE (
COUNTROWS ( 'Table' ),
'Table'[Start_date] <= sel
&& 'Table'[Leave_date] >= sel
)``````

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

Best Regards,
Henry

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 REPLIES 3
Community Support

Hi @petehorsch ,

You can try below formula:

``````mount =
VAR sel =
SELECTEDVALUE ( 'Date'[Date] )
RETURN
CALCULATE (
COUNTROWS ( 'Table' ),
'Table'[Start_date] <= sel
&& 'Table'[Leave_date] >= sel
)``````

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

Best Regards,
Henry

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Frequent Visitor

How do I create the 'Date'[Date} value you reference?

Memorable Member

Hi @petehorsch,

You can use:

``Count = CALCULATE(DISTINCTCOUNT('Table'[Guest]),FILTER('Table','Table'[Check In Date]<='Date'[Date]&&'Table'[Check Out Date]>='Date'[Date]))``

Works for you? Mark this post as a solution if it does!
Check out this blog of mine: How to Export Telemetry Data from Azure IoT Central into Power BI

Announcements

#### 2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

#### Ted's Dev Camp - January 26, 2023

This session will provide guidance and teach campers the skills required to build Power BI reports that support multiple languages.

#### Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

#### 2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors