Forum Discussion
Measure for calculating appointments
This unfortunately does not seem to provide the desired result:
Hi Anonymous ,
Please try:
TEST =
CALCULATE (
COUNT ( Appointment[Date appointment] ),
FILTER (
Appointment,
Appointment[Status] = "Planned"
|| Appointment[Status] = "Occurred"
)
)Rolling 6 =
CALCULATE (
CALCULATE (
[TEST],
FILTER ( 'Calendar', 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) )
),
DATESINPERIOD ( 'Calendar'[Date], MAX ( 'Calendar'[Date] ), 6, MONTH )
)
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
- Anonymous4 years agoNot applicable
Thank you for your respone Anonymous!
The Appointment[Booking date] should not be larger than the date that is displayed in the 'Date' column as shown below. Right now, this constraint is not in place, hence why the values in 'Rolling 6.2' are too large. Do you have any idea how to achieve this?
- Anonymous4 years agoNot applicable
Hi Anonymous ,
Please try:
Rolling 6 = CALCULATE ( CALCULATE ( [TEST], FILTER ( 'Appointment', 'Appointment'[Booking date] <= MAX ( 'Calendar'[Date] ) ) ), DATESINPERIOD ( 'Calendar'[Date], MAX ( 'Calendar'[Date] ), 6, MONTH ) )Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
- Anonymous4 years agoNot applicable
Anonymous I get the same result with this measure. The value for January 4th, for example, should be '942'. The booking date should not be larger than the 'row date' that is displayed in the table (which comes from Calendar[Date]). Any ideas?