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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.