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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
H3nning
Helper V
Helper V

Count Customers depending on bookings per day

Hi, i need help with a tough calculation i have to do.

 

I have customers and these customers have bookings lasting several days or even month. So each booking has a start and an end. And i have two different types of bookings, lets say A and B.

 

I want to calculate for each day how many customers I have with only A bookings, with only B bookings and with A and B bookings.

 

Bookingdata could look like this

 

CustomerBooking TypeStartEnd
1A01.01.202001.01.2022
1A03.01.202203.01.2022
1B03.01202205.01.2022
2B01.01.202201.01.2022
2B01.01.202201.01.2022
2B03.01.202203.01.2022

 

Result should be

DayA-Type CustomersB-Type CustomersAB-Type Customers
01.01.2022110
02.01.2022000
03.01.2022011
04.01.2022010
05.01.2022010

 

I also have a customers table and a date table as dimensions.

 

I managed to measure customers of a and b type seperately without taking into account if they have both with for example for A:

Calculate(Distinctcount(Customer),Filter(all(Bookingdata), Start<= Day && End >= Day && Booking Type = A))

 

But that way I cannot count only those with both A and B and these are counted double if I count A and B seperately.

 

Hope someone can help out. Thanks!

2 REPLIES 2
H3nning
Helper V
Helper V

Hi @amitchandak , thank you but that I already manged even with connected table. My Problem is that every ID has multiple entries with two diofferent states. And I want to count per day: How many with state A, how many with state B and most importantly how many with A and B without counting them double!

amitchandak
Super User
Super User

@H3nning , Create a disconnected date table, means do not join with your table

Then create a measure and use along with date from date table in visual

 

Calculate(distinctcount(Bookingdata[Customer]), filter(Bookingdata, Bookingdata[Start] >= Max(Date[Date]) && Bookingdata[END] >= Max(Date[Date]) ))

 

Check the HR example file attached

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.