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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Rolling period with starting date issue

I have a list of dates in an appointments table. For all the dates in the appointments table, I want to measure how many appointments there are from x date in the appointments table in the coming 6 months.

 

Does anyone know how to do this? Currently, I have the following, however this is not a correct DAX formula as you cannot have Appointments[Date appointments] in that place. I don't know what the starting date should be as I want this calculation for every appointment date in the table.

 

Any help is appreciated!

 

Rolling appts =

CALCULATE(COUNT(Appointments[Date appointment]),
DATESINPERIOD(Calendar[Date], Appointments[Date appointment], 6, MONTH))

1 ACCEPTED SOLUTION

Hi, 

Use this measure :

CntOfApp = CALCULATE( count(Sheet39[name of appointer]),
                      'Date'[Date] > max('Date'[Date])
                      &&
                     'Date'[Date] <= EDATE(max('Date'[Date]), 6)
                    )

MahyarTF_0-1658739519215.png

 

Mahyartf

View solution in original post

6 REPLIES 6
lukiz84
Memorable Member
Memorable Member

Hi,

 

try

 

VAR maxDate = MAX(Calendar[Date])

RETURN 

CALCULATE(
    COUNT(Appointments[Date appointment]),
    FILTER(
         ALL(Calendar),
         Calendar[Date] > maxDate && Calendar[Date] <= EDATE(maxDate, 6)
    )
)

 

BR

Hi, 

Use this measure :

CntOfApp = CALCULATE( count(Sheet39[name of appointer]),
                      'Date'[Date] > max('Date'[Date])
                      &&
                     'Date'[Date] <= EDATE(max('Date'[Date]), 6)
                    )

MahyarTF_0-1658739519215.png

 

Mahyartf
Anonymous
Not applicable

@lukiz84 Thank you for your reply! Unfortunately, this returns blank for me.

Hi,

 

even if you choose a date? When there's no date selected, then there are no appointments outside maxDate ... 

 

If you just want to - regardless of user selections - show the next 6 months, replace MAX(Calendar[Date]) with TODAY()

Anonymous
Not applicable

@lukiz84 This then shows the same value for all dates in the date table. I want it to show a different value for every date (provided that is correct). See image for reference.

 

Sohan_0-1658739240059.png

 

yeah sorry,

 

just dont filter the date table via FILTER, add the Calculate params as @MahyarTF did, then it works.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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