Skip to content

Instantly share code, notes, and snippets.

@Cabeda
Created August 22, 2018 07:25
Show Gist options
  • Save Cabeda/44c8e122cdb4bc5317aa5d9f75c122a7 to your computer and use it in GitHub Desktop.
Save Cabeda/44c8e122cdb4bc5317aa5d9f75c122a7 to your computer and use it in GitHub Desktop.
Column to detect if a date is in the last completed week relatively to today
IslastCompleteWeek =
IF (
WEEKNUM (
'Calendar'[Date],
2
) = IF (
WEEKNUM (
TODAY (),
2
) = 1,
WEEKNUM (
DATE ( YEAR (
(
TODAY ()
)
) - 1, 12, 31 ),
2
),
WEEKNUM (
TODAY (),
2
) - 1
) -- Is last complete week
&& 'Calendar'[Year] = YEAR (
(
TODAY ()
)
),
-- Current Year
TRUE (),
FALSE ()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment