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
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
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!

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
Top Kudoed Authors