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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.