You may at times need to create a date value in Power BI either using DAX or M, or in Excel. This is a quick post that describes how to create a date value in Power BI DAX, Power Query M language, and in Excel. Working with dates is an every-day thing for anyone that works with data.
In Power BI DAX, the syntax is:
DATE(<year>, <month>, <day>) //the parameters must be valid numbers
DATE(2025, 8, 23) //returns August 23, 2025
In Power Query M, the syntax is:
#date(<year>, <month>, <day>) //the parameters must be valid numbers
#date(2022, 3, 6) //returns March 6, 2022
In Excel, the syntax is:
DATE(<year>, <month>, <day>) //the parameters must be valid numbers
DATE(1989, 12, 3) //produces 12/3/1989 (officially returns a number that represents the date in Excel date-time code)
Thanks for reading. Hope you found this useful.
