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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Syndicate_Admin
Administrator
Administrator

Measure to calculate bookings created by selected check-in date

Hello everyone

I'm trying to calculate a measure in Power BI that shows me the bookings created for a hotel. My goal is that, when you select a specific month in a filter on the page (connected to my Dim_Date date table), a bar chart distributes the bookings created according to their creation date, but only for those bookings whose check-in date belongs to the selected month.

I am currently using this measure:

ReservasCreadas_MesCrea =

CALCULATE(

DISTINCTCOUNT('Fact_MovRvas'[RESERVA_PK]),

ALLEXCEPT('A0Dim_Fecha', A0Dim_Fecha[Month Name]),

'Fact_MovRvas'[FECHAENTRADA] IN VALUES(A0Dim_Fecha[Date])

)

The page filter is set to select year and month from the Dim_Date date table. However, the measure does not seem to work as I hope. Although the chart updates when you change the filter on the page, the bars are not distributed correctly based on the date of creation (DATECREATION), and it appears that bookings are not being filtered correctly by the date of entry.

I'd like to implement something similar for cancelled bookings, applying the same logic but with the cancellation date instead of the creation date.

Could someone guide me on how to adjust this measure to work as I hope? Any help will be greatly appreciated!

Thank you in advance. 😊

1 ACCEPTED SOLUTION
speedramps
Super User
Super User

You need to use a technique called "role play relationships"

 

Download my example PBIX solution from Onedrive, and read the info

Click here 

 

Look at Page1 and Page 2

Adapt it for your creation date, check in date and cancellation date. 

Create measure for eah and then you can mix and match them in filters.

speedramps_0-1737387046032.png

Please click the [acept solution] and thumbs up buttons to show your appreciation, thank you

View solution in original post

2 REPLIES 2
AmiraBedh
Super User
Super User

For your 1st measure :

ReservasCreadas_MesCrea =
CALCULATE(
    DISTINCTCOUNT('Fact_MovRvas'[RESERVA_PK]),
    'Fact_MovRvas'[FECHAENTRADA] IN VALUES(A0Dim_Fecha[Date]),
    REMOVEFILTERS(A0Dim_Fecha)
)

 

For the canceled measure :

ReservasCanceladas_MesCancela =
CALCULATE(
    DISTINCTCOUNT('Fact_MovRvas'[RESERVA_PK]),
    'Fact_MovRvas'[FECHAENTRADA] IN VALUES(A0Dim_Fecha[Date]),
    REMOVEFILTERS(A0Dim_Fecha)
)

Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696
speedramps
Super User
Super User

You need to use a technique called "role play relationships"

 

Download my example PBIX solution from Onedrive, and read the info

Click here 

 

Look at Page1 and Page 2

Adapt it for your creation date, check in date and cancellation date. 

Create measure for eah and then you can mix and match them in filters.

speedramps_0-1737387046032.png

Please click the [acept solution] and thumbs up buttons to show your appreciation, thank you

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors