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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Sohan
Helper III
Helper III

Measure for every date in date table

I have a measure that counts the number of appointments in the coming 6 months for a given day:

 

 

 

OW = CALCULATE(COUNT(Appointments[Date appointment]),
DATESINPERIOD(Appointments[Date appointment], TODAY(), 6, MONTH))

 

 

 

For example: from February 9th until August 8th there are 1557 appointments. I have a seperate date table with all dates in it until 2025. For all dates in this date table, I want the above measure, however the Appointment[Date booking] may not be larger than the date in the date table.. Does anyone know how I can achieve this?

4 REPLIES 4
Anonymous
Not applicable

Hi  @Sohan ,

PBIX is not accessible, you can re-upload it.

I created some data:

vyangliumsft_0-1644912779670.png

Here are the steps you can follow:

1. Create measure.

OW =
CALCULATE(COUNT(Appointments[Date appointment]),FILTER(ALL(Appointments),'Appointments'[Date appointment]>=DATE(YEAR(TODAY()),MONTH(TODAY())-6,DAY(TODAY()))&&'Appointments'[Date appointment]<=TODAY()))

2. Result:

vyangliumsft_1-1644912779673.png

 

Best Regards,

Liu Yang

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

Hi @Anonymous thanks for your response! It unfortunately is not the solution I'm looking for. I have re-uploaded the file. I hope this clarifies things! PBIX file 

amitchandak
Super User
Super User

@Sohan , Create a date table with all the dates in Date appointment

 

Then create a measure for a future date
OW = CALCULATE(COUNT(Appointments[Date appointment]),
DATESINPERIOD(Date[Date], TODAY(), 6, MONTH))

 

past 6 month

OW = CALCULATE(COUNT(Appointments[Date appointment]),
DATESINPERIOD(Date[Date], TODAY(), -6, MONTH))

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

Hi @amitchandak thanks for your reply! This is not exactly what I'm looking for. I have added a PBIX file with a sample dataset and an example of what I want. I hope this clarifies what I'm looking for.

 

Sample PBIX file 

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.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors