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!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
I put your expression into DAXFormatter.com and it didn't give an error (or fixed it automatically). Here it is:
Calendar =
GENERATE (
CALENDAR ( DATE ( 2016, 1, 1 ), TODAY () ),
VAR startOfWeek = 1 // Where 1 is Sunday and 7 is Saturday, thus a 3 would be Tuesday
VAR currentDay = [Date]
VAR days =
DAY ( currentDay )
VAR months =
MONTH ( currentDay )
VAR years =
YEAR ( currentDay )
VAR nowYear =
YEAR ( TODAY () )
VAR nowMonth =
MONTH ( TODAY () )
VAR todayNum =
WEEKDAY ( TODAY () )
RETURN
ROW (
"day", days,
"month", months,
"year", years,
"month index", INT ( ( years - nowYear ) * 12 + months - nowMonth ),
"year index", INT ( years - nowYear )
)
)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
I still get the error message.
Hi @Anonymous @mahoneypat
I don't get any error.
Could you share error message with me?
Try use ";" to replace "," in your query and check if it is correct.
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Weird. I put it in Power BI and generated your Calendar table w/o error.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 19 | |
| 12 | |
| 9 | |
| 8 | |
| 8 |