Forum Discussion
Anonymous
3 years agoNot applicable
Last weekend in Month
Hi, I'm not able to find a solution. I'm trying to get the last Saturday in month. For example, July 2022 Sat ended on the 30th and Nov Saturday ended on 26th. How do you calculate and get the ...
- 3 years ago
Anonymous Try:
Measure = VAR __Date = MAX('Table'[Date]) VAR __SoM = DATE(YEAR(__Date),MONTH(__Date),1) VAR __EoM = EOMONTH(__Date,0) VAR __Table = ADDCOLUMNS( CALENDAR(__SoM, __EoM), "__WeekDay", WEEKDAY([Date],1) ) VAR __Result = MAXX(FILTER(__Table, [__WeekDay] = 7),[Date]) RETURN __Result
Greg_Deckler
Community Champion
3 years agoAnonymous Try:
Measure =
VAR __Date = MAX('Table'[Date])
VAR __SoM = DATE(YEAR(__Date),MONTH(__Date),1)
VAR __EoM = EOMONTH(__Date,0)
VAR __Table =
ADDCOLUMNS(
CALENDAR(__SoM, __EoM),
"__WeekDay", WEEKDAY([Date],1)
)
VAR __Result = MAXX(FILTER(__Table, [__WeekDay] = 7),[Date])
RETURN
__Result