Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hello,
I have a problem with the week number, in the transition from 2021 to 2022, I get this:
For getting the week number I have followed this formula when adding a custom column, which I got from this topic: (https://community.powerbi.com/t5/Desktop/Incorrect-week-number-Trasnform-Date-to-Week-of-Year/m-p/57...)
Date.WeekOfYear([Date], Day.Sunday)
So as you can see I am using the same formula but for me it is not working, 1st of Jan which is a Saturday is considered as Week 1 of 2022 instead of Week 53 of 2021, even though my formula clearly specifies that the start of each week is on a Sunday, so 2nd of Jan should actually be week 1.
Any ideas how to fix this please ?
Thank you!
@Bratone , calculate week year and week number based on week start date , new columns in date table
Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1 // Monday start
Week Year = year([Week Start Date])
min week start of year = minx(filter('Date',[Year] =earlier([Year])),[Week Start date])
week No = quotient(datediff([min week start of year],[date],day),7)+1
Followed your formulas and I get the same thing, 1st of Jan is still WK1 (instead of WK53 of 2021) and 2nd of Jan is still WK2.
The only thing that I changed was in the first column, I used:
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
119 | |
102 | |
73 | |
65 | |
40 |