0

i am trying to create a custom column using Mon-Year_period = FORMAT(trial[Date],"MMM-YYYY"). It gets accepted when write for custom column but when I close and apply the same, says FORMAT function error. Also, when tried the same for calculated column, then the calculated column in this table is not present when I try to join this table with another.

Please help. Requirement - c column that contains the date in (MMM_YYYY) format and also need to use that column in another table.

Anu
  • 1
  • 1

1 Answers1

0

Your formula looks correct and since you are using the FORMAT function I assume you are using a DAX calculated column.

You can also use an M formula to calculate it, which will allow you "view" this column in other tables if you join them in the query editor, in fact, DAX calculated columns are created after the data load.

Using M custom column (query editor) use this formula

Date.ToText([DateColumn],"MMM-yyyy")

Using DAX calculated column (the same you already have)

Column = FORMAT('Table'[DateColumn],"MMM-yyyy")

About the error, it might be caused by an invalid value, I suggest you set the column as type "Date" (in query editor), if there are invalid values powerBI will tell you so

Giovanni Luisotto
  • 1,382
  • 7
  • 12