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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Elofly
Frequent Visitor

Distinctcount on a dynamic period of time

Dear all,

 

I am trying to count the number of active properties I have during a certain period of time. (60 days).

That is to say, i want to count the number of property ID that I have from the first day of the month for the past 60 days. Count of property being those that have performed one reservation.

 

So I have a table with

Booking date - Property ID

Elofly_0-1644586425581.png

 

I would like to calculate number of active properties in June 2020 - that is to say count from 01/04/2020 to 01/06/2020

 

Thanks a lot for your help!

2 ACCEPTED SOLUTIONS
Whitewater100
Solution Sage
Solution Sage

Whitewater100
Solution Sage
Solution Sage

Hi:

I put together a file that answers your requirements...I believe. I used dummy data as none was supplied.

What's missing?

https://drive.google.com/file/d/1b0mgwnTdl6aNiPcbHdQxtLohxs4lvRmg/view?usp=sharing

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi @Elofly ,

 

Eyelyn9_0-1645599511597.png

Could you tell me if your problem has been solved? If it is, kindly Accept a helpful reply as the solution. More people will benefit from it.

 

Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

How to Get Your Question Answered Quickly - Microsoft Power BI Community

How to provide sample data in the Power BI Forum - Microsoft Power BI Community

 

 

Best Regards,
Eyelyn Qin

Whitewater100
Solution Sage
Solution Sage

Hi:

I put together a file that answers your requirements...I believe. I used dummy data as none was supplied.

What's missing?

https://drive.google.com/file/d/1b0mgwnTdl6aNiPcbHdQxtLohxs4lvRmg/view?usp=sharing

tamerj1
Super User
Super User

Hi @Elofly 

Please calrify "Count of property being those that have performed one reservation." Do you mean al least one reservation or you mean only one reservation.

do you have a date table connected to bookingdate column?

what kind of visual are going to use? A screenshot will be of great help. 

Hi Tamer,

 

I mean at least one reservation in the next 60 days.

I have one table with all the bookings per HotelID and one table as a calendar.

I would like to use that kind of visual to see over time and every month how many unique properties were active:

Elofly_0-1644845580762.png

Thanks a lot for your help!

Whitewater100
Solution Sage
Solution Sage

Hi Elofly:

 

Please find link to a hopeful solution for you.

 

https://drive.google.com/file/d/1k1zx52swBgy8FwXthweXaeowJNye1-iU/view?usp=sharing 

Hello:

That was a good question tamerj1 had. I assumed you had all unique records in your example table. Can you mention which columns you use and how you count to determine if a property is active?

 

I would teweaak the file I made for you if your approach is different than I imigained.

 

Thanks!

 

Thanks a lot for your help! You have been very useful.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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