Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
How would I create a date table in Dax that lists the start date and end date of each month from 01/07/2007 to 31/12/2099 similar to the format below? Thank you in advance
@amitchandak @tamerj1 @danextian @goncalogeraldes
Solved! Go to Solution.
Hi @spandy34
please try
Month Date =
VAR MinDate =
DATE ( 2007, 7, 1 )
VAR MaxDate =
DATE ( 2099, 12, 31 )
VAR Months =
DATEDIFF ( MinDate, MaxDate, MONTH )
VAR T1 =
GENERATESERIES ( 0, Months, 1 )
RETURN
SELECTCOLUMNS (
T,
"StartDate", EDATE ( Mindate, [Value] ),
"EndDate", EOMONTH ( MinDate, [Value] )
)
Sorry its a typo in the variable name
Month Date =
VAR MinDate =
DATE ( 2007, 7, 1 )
VAR MaxDate =
DATE ( 2099, 12, 31 )
VAR Months =
DATEDIFF ( MinDate, MaxDate, MONTH )
VAR T =
GENERATESERIES ( 0, Months, 1 )
RETURN
SELECTCOLUMNS (
T,
"StartDate", EDATE ( Mindate, [Value] ),
"EndDate", EOMONTH ( MinDate, [Value] )
)
Hi @spandy34 ,
Here are the steps you can follow:
1. Create calculated table.
Table =
var _table1=
CALENDAR(
DATE(2007,1,1),
DATE(2099,12,31))
var _table2=
ADDCOLUMNS(
_table1,"Enddate",EOMONTH([Date],0))
return
FILTER(
_table2, [Date]=MINX(FILTER(_table2,YEAR([Date])=YEAR(EARLIER([Date]))&&MONTH([Date])=MONTH(EARLIER([Date]))),[Date]))
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@spandy34
Please refer to attached sample file with the solution
Month Date =
VAR MinDate =
DATE ( 2007, 7, 1 )
VAR MaxDate =
DATE ( 2099, 12, 31 )
VAR Months =
DATEDIFF ( MinDate, MaxDate, MONTH )
VAR T =
GENERATESERIES ( 0, Months, 1 )
RETURN
SELECTCOLUMNS (
T,
"StartDate", EDATE ( Mindate, [Value] ),
"EndDate", EOMONTH ( MinDate, [Value] )
)
Hi @tamerj1 ,
Sorry, this was an oversight on my part, I didn't think about performance, this does cause the compute table to be iterated twice, resulting in a waste of resources.
Thanks for the heads up, I'm glad you made a correction to my problem, I'll pay more attention to this area in the future.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more
@spandy34
Please refer to attached sample file with the solution
Month Date =
VAR MinDate =
DATE ( 2007, 7, 1 )
VAR MaxDate =
DATE ( 2099, 12, 31 )
VAR Months =
DATEDIFF ( MinDate, MaxDate, MONTH )
VAR T =
GENERATESERIES ( 0, Months, 1 )
RETURN
SELECTCOLUMNS (
T,
"StartDate", EDATE ( Mindate, [Value] ),
"EndDate", EOMONTH ( MinDate, [Value] )
)
Hi @spandy34 ,
Here are the steps you can follow:
1. Create calculated table.
Table =
var _table1=
CALENDAR(
DATE(2007,1,1),
DATE(2099,12,31))
var _table2=
ADDCOLUMNS(
_table1,"Enddate",EOMONTH([Date],0))
return
FILTER(
_table2, [Date]=MINX(FILTER(_table2,YEAR([Date])=YEAR(EARLIER([Date]))&&MONTH([Date])=MONTH(EARLIER([Date]))),[Date]))
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Anonymous
That would definitely work. But why to create a 35k rows calendar table then iterate over it two times, first time to add a 35k rows column and 2nd time to filter it down 1k rows, while the same can be achieved in one iteration over a 1k rows series table which is 315 times faster?
@spandy34 have you tried what I posted?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@spandy34 of simply add two columns in the date dimension using following code:
Start of Month = EOMONTH ( Calendar[Date], -1 ) + 1
End of Month = EOMONTH ( Calendar[Date], 0 )
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi @spandy34
please try
Month Date =
VAR MinDate =
DATE ( 2007, 7, 1 )
VAR MaxDate =
DATE ( 2099, 12, 31 )
VAR Months =
DATEDIFF ( MinDate, MaxDate, MONTH )
VAR T1 =
GENERATESERIES ( 0, Months, 1 )
RETURN
SELECTCOLUMNS (
T,
"StartDate", EDATE ( Mindate, [Value] ),
"EndDate", EOMONTH ( MinDate, [Value] )
)
Hi
I get this message
Sorry its a typo in the variable name
Month Date =
VAR MinDate =
DATE ( 2007, 7, 1 )
VAR MaxDate =
DATE ( 2099, 12, 31 )
VAR Months =
DATEDIFF ( MinDate, MaxDate, MONTH )
VAR T =
GENERATESERIES ( 0, Months, 1 )
RETURN
SELECTCOLUMNS (
T,
"StartDate", EDATE ( Mindate, [Value] ),
"EndDate", EOMONTH ( MinDate, [Value] )
)
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!