Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Booking date filter

I have the following DAX formula which counts the number of appointments in the coming 6 months.

 

Sum of coming appointments = 
CALCULATE([Sum appointments],
          DATESINPERIOD(Calendar[Date],
                        LASTDATE(Calendar[Date]), 6, Month
                       )
         )

 

 

This DAX formula, when visualised with the Calendar[Date] field, produces the following:

I would like there to be a filter on the Calendar[Date] field, which expresses that Appointment[Booking date] (for the sum) is not larger than the visualized date in Calendar[Date]. 

 

Essentially on a given date, I want a sum of the appointments in the coming 6 months, where the booking date is not larger than the starting date of the calculation.

 

As an example:

For January 2nd, I want the calculation period to be January 2nd - July 1st. The booking date should not be larger than January 2nd.

 

Does anyone know how this can be achieved?

 

Any help would be greatly appreciated!

2 Replies