Forum Discussion
Need help creating a table in PowerBi
Hi Earl40 ,
ADDCOLUMNS(
_table1,"Year",YEAR([Date]),"Month",FORMAT([Date],"mmmm"))
ADDCOLUMNS function means:
Adds calculated columns to the given table or table expression.
ADDCOLUMNS function (DAX) - DAX | Microsoft Learn
The function _Table1 creates a table of dates in the interval 2023.1.1 - 2023.12.31.
"Year",YEAR([Date]): represents the creation of a column with the name Year, and the data inside is the Year of each date.
"Month",FORMAT([Date], "mmmm")): represents the creation of a column, the column name is Month, the data inside is the month of each date, the month is in the format of "mmmm".
Format () function means:
Converts a value to text according to the specified format.
FORMAT function (DAX) - DAX | Microsoft Learn
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.