Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
2 years ago

Filter by date

Dear friends, good day.

Let me tell you that I have created a calendar table in my model

Calendar = Were Date = CALENDAR(DATE(2020,1,1),TODAY())return SELECTCOLUMNS(Date, "Date", [Date], "Year", YEAR([Date]), "My", UPPER(FORMAT([Date],"MMM")), "MesNro", INT(FORMAT([Date], "M")),"NroDia", INT(FORMAT([Date], "d")), "DayWeek", WEEKDAY([Date],2 ), "Week", VIKUNUM([Date],2), "Weekend", WEEKDAY([Date],2)In {6,7}, "Name Dia", UPPER(FORMAT([Date], "DDDD")),"SemNro", ROUNDUP(MONTH([Date])/6,0 ), "SortMonthYear", YEAR([Date])*100 + MONTH([Date]),"M_Y", UPPER(FORMAT([Date], "MMM"))&"-"& RIGHT(YEAR([Date]),2))

In which I was able to create a column that would indicate the current month and the previous month

Period Month = SWITCH(TRUE(),
EOMONTH(TODAY(),0) = EOMONTH(Calendar[Date],0), "Current Month",
EOMONTH(TODAY(),-1) = EOMONTH(Calendar[Date],-0), "Previous month")
But, I need to do the same with the week, which I haven't been able to find the solution to........

1 Reply