How to: Group Dates by Week in Power BI
This post shows you how to use the date hierarchy and the grouping function to easily group your data by year, month, week in Power BI. This can be very handy when reporting against data that is time phased, such as sales transactions or Project Online schedule and capacity data.
If you need to start your week on a specific day of the week, you can create a new column based on your date, using this DAX statement:
Week Beginning Date = ‘TableName'[DateFieldName] – MOD(‘TableName'[DateFieldName]-1,7) + [Add 0 for Sunday, 1 for Monday, etc. to start week accordingly]
See the video below to see how this code is used.
December 08, 2020 at 3:09 am, Ane Mare said:
how did you manage to show both the month and week on your x-axis when you drilled down?
October 27, 2021 at 10:11 pm, Selin said:
Easy and effective way of showing weekly numbers. Thanks!