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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
MaicLioulias
New Member

Calculate average room price between check in check out

Hi,

 

Depending on the the date range a guest is staying, I want to calculate the revenues per month.

For example, I want the average daily revenues of the reservations below to be split depending on the month they belong. 

 

More precisely, in the first row:

- (25/3 - 31/3) * 92.25

&

- 1/4 * 92.25 (checked out date is not counted as stay in)   

 

Checked In25/03/2302/04/2392,25
Checked In26/03/2302/04/2394,80
Checked In26/03/2302/04/23123,88

 

I don't know if my information are clear but thank you in advance for any help.

 

2 REPLIES 2
olgad
Super User
Super User

@MaicLioulias Have my answer solved your problem? If so, can you please accept my answer as Solution to help other members find it faster? Thank you very much for your kind cooperation!


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime
olgad
Super User
Super User

Hi,  not sure how you want to slice it and dice it, but here are some ideas. 

olgad_0-1680349536686.png

Datediff = DATEDIFF( Hotel[Checked In],Hotel[Check out],MONTH)
First half of Stay = If(Hotel[Datediff]>0, Datediff( Hotel[Checked In],EOMONTH(Hotel[Checked In],0),DAY)+1, DATEDIFF(Hotel[Checked In],Hotel[Check out],DAY))
2nd half of stay = If(Hotel[Datediff]>0, DATEDIFF(EOMONTH(Hotel[Checked In],0)+1, Hotel[Check out],DAY),Hotel[Datediff])
 
This shall give you the calcs for the day difference that can be now multiplied with the respective rates. 
 
Another way is to transform your data in power query.
Add previous day to a check out day
olgad_1-1680349942650.png

 

olgad_2-1680349971466.pngolgad_3-1680350134797.pngolgad_4-1680350164710.pngolgad_5-1680350219452.png

Change the data type to date

olgad_6-1680350248458.png

Now you can create a calendar table hook it up with dates of stay and that is it, have your revenue calculated easily. 

 

Please refer to this article to learn more: 

https://www.linkedin.com/pulse/hr-reporting-generating-records-between-start-end-values-dontsova/?tr...


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors