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
meredink91
Frequent Visitor

DAX Equation for Table - Need for Date Info to Start on Specific Day

Hello,

 

I'm trying to set up a rolling date table and need for it to start on a specific date (April 1, 2024). This is the DAX equation that I was that I have and need help with what needs to be added or modified. Thanks!

 

DateTAfterApr2024 =
VAR MinYear = YEAR (DATE(2024,04,01 ) )
VAR MaxYear = YEAR ( TODAY())
RETURN
ADDCOLUMNS (
FILTER (
CALENDARAUTO( ),
AND ( YEAR ( [Date] ) >= MinYear, YEAR ( [Date] ) <= MaxYear )
),
"Calendar Year", "CY " & YEAR ( [Date] ),
"Month Name", FORMAT ( [Date], "mmmm" ),
"Month Number", MONTH ( [Date] ),
"Month Year", format([Date],"mmm yyyy"),
"Month year Sort", format([Date],"YYYYMM"),"Calendar Quarter/Year", QUARTER( [Date] )&"/"&YEAR ( [Date] ))

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @meredink91 ,

 

Thanks for the reply from lbendlin .

 

Please try this syntax, which I modified based on your measure:

DateTAfterApr2024 =
VAR StartDate = DATE(2024, 04, 01)
VAR EndDate = TODAY()
RETURN
ADDCOLUMNS(
    FILTER(
        CALENDAR(StartDate, EndDate),
        AND(
            YEAR([Date]) >= YEAR(StartDate),
            YEAR([Date]) <= YEAR(EndDate)
        )
    ),
    "Calendar Year", "CY " & YEAR([Date]),
    "Month Name", FORMAT([Date], "mmmm"),
    "Month Number", MONTH([Date]),
    "Month Year", FORMAT([Date], "mmm yyyy"),
    "Month year Sort", FORMAT([Date], "YYYYMM"),
    "Calendar Quarter/Year", "Q" & QUARTER([Date]) & "/" & YEAR([Date])
)

 

I replaced the CALENDARAUTO function with CALENDAR to create a date table based on the conditions you gave.

 

If you have any other questions please feel free to contact me.

 

Best Regards,
Yang
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!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @meredink91 ,

 

Thanks for the reply from lbendlin .

 

Please try this syntax, which I modified based on your measure:

DateTAfterApr2024 =
VAR StartDate = DATE(2024, 04, 01)
VAR EndDate = TODAY()
RETURN
ADDCOLUMNS(
    FILTER(
        CALENDAR(StartDate, EndDate),
        AND(
            YEAR([Date]) >= YEAR(StartDate),
            YEAR([Date]) <= YEAR(EndDate)
        )
    ),
    "Calendar Year", "CY " & YEAR([Date]),
    "Month Name", FORMAT([Date], "mmmm"),
    "Month Number", MONTH([Date]),
    "Month Year", FORMAT([Date], "mmm yyyy"),
    "Month year Sort", FORMAT([Date], "YYYYMM"),
    "Calendar Quarter/Year", "Q" & QUARTER([Date]) & "/" & YEAR([Date])
)

 

I replaced the CALENDARAUTO function with CALENDAR to create a date table based on the conditions you gave.

 

If you have any other questions please feel free to contact me.

 

Best Regards,
Yang
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!

lbendlin
Super User
Super User

If it needs to start on a specific day then it is not a rolling table.

 

You can use CALENDAR("2024-04-01",TODAY())

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.