Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Syndicate_Admin
Administrator
Administrator

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))
RodriCP_0-1705513708649.png

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 1
Fowmy
Super User
Super User

@Syndicate_Admin 

Add this column:

Prev Week = WEEKNUM( [Date] - WEEKDAY([Date],2) , 2)



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.