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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
alihijazi
Helper I
Helper I

Token eof expected

Hello

I'm trying to create a Calendar using List.Date function

I got the list correctly and I converted the list to a table

Now I want to create custom columns to have the year, month, etc...

However I'm getting an error saying Token eof expected; what's wrong? please adviseeof_expected.png

1 ACCEPTED SOLUTION
MattAllington
Community Champion
Community Champion

=[Date].Year([Date]) is not a valid formula.

 

Try duplicating the date column 3 times.  Then for each new column, use the menu Transform\Date\Year etc



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

3 REPLIES 3
alexpancakes
Microsoft Employee
Microsoft Employee

= Date.Year([Date]) is the correct formula.

So "Date.Year()" is the function and the "[Date]" is it's argument.

SabineOussi
Skilled Sharer
Skilled Sharer

Try

Date.Year([Date])

Date.Month([Date])

MattAllington
Community Champion
Community Champion

=[Date].Year([Date]) is not a valid formula.

 

Try duplicating the date column 3 times.  Then for each new column, use the menu Transform\Date\Year etc



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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