Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
How do I get the week number based on the date that I set as first week ? For example 2023-05-21 should be Week 1 instead of 2023-01-01
Thanks,
Solved! Go to Solution.
Hi @Sfns_2024s
Try the following dax
Custom Week Number =
VAR CustomStartDate = DATE(2023, 5, 21)
VAR CurrentDate = 'Table'[Date] .[Date]
VAR DaysDiff = CurrentDate - CustomStartDate
VAR WeeksFromCustomStart = INT(DaysDiff / 7)
RETURN IF(DaysDiff < 0, BLANK(), WeeksFromCustomStart + 1)
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Sfns_2024s
Try the following dax
Custom Week Number =
VAR CustomStartDate = DATE(2023, 5, 21)
VAR CurrentDate = 'Table'[Date] .[Date]
VAR DaysDiff = CurrentDate - CustomStartDate
VAR WeeksFromCustomStart = INT(DaysDiff / 7)
RETURN IF(DaysDiff < 0, BLANK(), WeeksFromCustomStart + 1)
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Use an external reference table for your calendar where you have the fiscal year or fiscal quarter weeks marked as a dedicated column. This can be an Excel file on a SharePoint, for example.
User | Count |
---|---|
20 | |
18 | |
17 | |
11 | |
7 |
User | Count |
---|---|
29 | |
28 | |
13 | |
12 | |
12 |