Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Date =
ADDCOLUMNS (
CALENDAR (
DATE ( YEAR ( MIN ( 'Sales'[Date] ) ), 1, 1 ),
DATE ( YEAR ( MAX ( 'Sales'[Date] ) ), 12, 31 )
),
"Year", YEAR ( [Date] ),
"Quarter Number", INT ( FORMAT ( [Date], "q" ) ),
"Quarter", "Q" & INT ( FORMAT ( [Date], "q" ) ),
"Month Number", MONTH ( [Date] ),
"Month", FORMAT ( [Date], "mmmm" ),
"Week Day Number", WEEKDAY ( [Date] ),
"Week Day", FORMAT ( [Date], "dddd" ),
"Year Month Number", YEAR ( [Date] ) * 100
+ MONTH ( [Date] ),
"Year Month", FORMAT ( [Date], "mmmm" ) & " "
& YEAR ( [Date] ),
"Year Quarter Number", YEAR ( [Date] ) * 100
+ INT ( FORMAT ( [Date], "q" ) ),
"Year Quarter", "Q" & FORMAT ( [Date], "q" )
& "-"
& YEAR ( [Date] )
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment