top of page

Date Table in DAX

  • Writer: Robert J Engstrom
    Robert J Engstrom
  • Nov 8, 2019
  • 1 min read

If you need a date table for your date dimension, this DAX query is great to use:



Calendar =

VAR _calendar =

CALENDAR ( "1/1/2011", "12/31/2019" )

RETURN

ADDCOLUMNS (

_calendar,

"Year", YEAR ( [Date] ),

"MonthNumber", MONTH ( [Date] ),

"Month", FORMAT ( [Date], "mmmm" ),

"Quarter", "QTR " & FORMAT ( [Date], "Q" ),

"QuaterNumber", FORMAT ( [Date], "Q" ),

"MonthYearNumber", FORMAT([Date], "yy mm"),

"Month Year", FORMAT([Date], "mmm yyyy")


- Please note that you can change the dates in the 3rd row to the dates you need to use.


Comments


© 2019 by Robert J Engstrom

bottom of page