How to create a current week view in Microsoft Lists
Creating views in Microsoft Lists is a straightforward process and it can be done using the UI to apply filters, group elements or even order the items as you wish. Despite the simplicity you can go a step further and use expressions and functions to display your data in different formats and create advanced views.
In this article you will learn how to create a view to filter the items created in the current week from Monday to Sunday.
To implement this solution, you’ll need to use calculated columns and functions, if you are not familiar with the concept you can learn more about it here.
How to create week columns in Microsoft Lists
The first step is to create 3 new columns:
- Week start – The initial day of week when the item was created
- Week end – The final day of the week when the item was created
- Week day – This one is option and will be used to easily show the day of the week when the item was created.
To create the new columns, you will need to do the following process 3 times one for each column:
- On your lists in Microsoft Lists click in the Add Column option and then in the drop down select More… At the time of writing calculated columns are only available in the classic SharePoint interface.
- Provide a name for the column
- In the type of column select Calculated (calculation based on other columns)
- The next step is defining the formula that will calculate the dates based in the created column that exists by default in the list. The list below has the formulas and the return data type you should select for each one of the 3 columns. This calculation uses the WEEKDAY function and you can learn more about it here.
- Week start
- Formula: =Created-(WEEKDAY(Created,3))
- Data Type: Date and Time with Date Only format
- Week end
- Formula: =Created+(6-WEEKDAY(Created,3))
- Data Type: Date and Time with Date Only format
- Week day
- Formula: =WEEKDAY(Created,3)
- Data Type: Number
- Week start
- Click OK to add the column to the view
Once you complete this process for each one of the columns you should get something like what is illustrated in the following picture with the 3 new columns added to the end of the lists.
How to create a list view for the current week
Now that you got all the columns needed added to the list it is time to create the view that will filter the items that were created in the current week, to implement it you should do the following:
- From the list in Microsoft Lists click in the cog icon and then click in the List Settings option
- Scroll down to the bottom of the page and click Create View
- From the list of available options click on Standard View
- Provide a name for the view
- Select the columns you would like to display
- Expand the Filter section
- Select the option Show items only when the following is true
- Build the condition as shown in the following image
Week Start is lee than or equal to [Today] AND Week End is greater than or equal to [Today]
The [Today] syntax is used to filter a column based on the current day
- Click OK to save it
Your newly created view should now filter all the items created in the current week, to start using it you just need to choose it from the view selector dropdown.
As you can see the in the above picture the new view is not showing the beginning and the end of the week as that information is only needed to apply the filter. It is showing the weekday when it was created, but with a number and not as string.
How to format weekdays using column formatting in Microsoft Lists
The WEEKDAY function used in the weekday calculated column returns the day of the week between 0 and 6, despite the unfriendly format you will be able to modify it using Microsoft Lists column formatting by doing the following:
- With the new view selected click in the dropdown icon in the weekday column
- Expand the Column settings
- Click in the Format this column option
- From the format column side panel click in the Advanced mode
- In the text box paste the following JSON code
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "=if(@currentField == 0, 'Monday', if(@currentField == 1, 'Tuesday', if(@currentField == 2, 'Wednesday', if(@currentField == 3, 'Thursday', if(@currentField == 4, 'Friday', if(@currentField == 5, 'Saturday', if(@currentField == 6, 'Sunday','')))))))" }
- Click Save
With the current week view created and the weekday column formatted you will get a result similar to what is shown in the following image.
If you would like to implement this solution for a different date range or to start your week on a Sunday let me know in the comment section and I’ll help you out building the formulas and the formatting for that.
February 1, 2023
Hi. Thanks heaps for this post. I’ve been adding this to lots of my stuff. Is it possible to creat a link that would direct a user to this particular view straight away?
March 23, 2023
Hi Matt,
I’m not sure if I understood correctly your question but you can define the week view as the default view for your list.
Alternatively you can grab the view link to make it available in your intranet so users open directly the desired view.
Hope this helps, have a nice day
April 6, 2023
That is exactly what I did – grabbed the link, inserted the %20 for spaces between the words in the link name and it works! Thanks heaps for your help and all the fantastic ideas you share with us!
March 21, 2023
Hi Joao, I really like your content! And I would like to ask you if you know the answer obviously I’m having issues this week 3/21/2022 using this filter, it is not showing me in my company SharePoint the items that were created, do you know any workaround? My best regards!
March 23, 2023
Hi Itzael,
I also had the same issue in my lists, something must have happened with the WEEKDAY formula.
To fix it edit each one of the calculated columns, modify the WEEKDAY formula to something like
WEEKDAY(Created,2)
and Save it.Edit each one of the columns again and modify the WEEKDAY formula to the original value
WEEKDAY(Created,3)
and Save it.This should calculate all the dates again.
Let me know if it worked for you, have a nice day.
March 22, 2023
Hi João,
I have implemented this view with success on a scheduling list that I created, however it has suddenly stopped displaying items. I have reviewed all of my column calculations, and the filter settings, and all appear to be correct. Is there anything you can think of that would perhaps cause this to stop working?
March 23, 2023
Hi James,
I also had the same issue in my lists, something must have happened with the WEEKDAY formula.
To fix it edit each one of the calculated columns, modify the WEEKDAY formula to something like
WEEKDAY(Created,2)
and Save it.Edit each one of the columns again and modify the WEEKDAY formula to the original value
WEEKDAY(Created,3)
and Save it.This should calculate all the dates again.
Let me know if it worked for you, have a nice day.
September 8, 2023
Hi João,
On a traditional SharePoint calendar I can add the following to the calendar URL to show the month of October upon page load, for example: ?CalendarDate=01/10/2023
Sadly this does not work for Microsoft Lists Calendar. Is there a way to make it so the calendar loads to a specific month rather than current month?
January 29, 2024
Hi Keenan,
With the current version of the calendar it will always default to the current month, week or day.
Have a nice day 🙂
November 8, 2023
Muito obrigada, João. I found this super helpful. I was able to follow the steps. You’re a legend!
January 26, 2024
Thanks you so much 🙂