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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Copy column and set date to End of Month

I'm trying to create a new column that is the calculated end of month from the date in another column.  Using this formula, but getting error that "EOMONTH" wasn't recognized

 

= Table.AddColumn(#"Renamed Columns", "AccountingDate", each EOMONTH([DATE],0))

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @Anonymous, it looks like you are trying to do this in the Query Editor as most of the code below is Power Query functions. DAX can't be used in the Query Editor, so you can't use the EOMONTH() DAX function.

 

Is there a reason you are doing this inside the query editor, rather than doing it in the "Modeling" tab of Power BI desktop (after you load the data from your query into your model)?

 

If you must do this within the Query Editor, try using the M function Date.EndOfMonth. You can find more details on the syntax here: https://msdn.microsoft.com/en-us/library/mt260695.aspx

View solution in original post

v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

As JaredK mentioned above, to use EOMONTH Function (DAX), you need to go to Modeling tab -> click "New Column" and enter your DAX formula.

NewColumn = EOMONTH(Table1[DateTimeStamp], 0)

cc1.PNG

 

For more details about how to create calculated columns in Power BI Desktop, you can refer to this article.Smiley Happy

 

Regards

View solution in original post

2 REPLIES 2
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

As JaredK mentioned above, to use EOMONTH Function (DAX), you need to go to Modeling tab -> click "New Column" and enter your DAX formula.

NewColumn = EOMONTH(Table1[DateTimeStamp], 0)

cc1.PNG

 

For more details about how to create calculated columns in Power BI Desktop, you can refer to this article.Smiley Happy

 

Regards

Anonymous
Not applicable

Hi @Anonymous, it looks like you are trying to do this in the Query Editor as most of the code below is Power Query functions. DAX can't be used in the Query Editor, so you can't use the EOMONTH() DAX function.

 

Is there a reason you are doing this inside the query editor, rather than doing it in the "Modeling" tab of Power BI desktop (after you load the data from your query into your model)?

 

If you must do this within the Query Editor, try using the M function Date.EndOfMonth. You can find more details on the syntax here: https://msdn.microsoft.com/en-us/library/mt260695.aspx

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors