Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Good morning All,
Our company has change financial calendar. This means that January is starting since 5th of January (calendar week 02) and month closed is in 30th of January (calendar week 05). My calendar looks like below:
Could do you help me to tweak range 28/12/2025 - 03/01/2026 as week 53 in 2025 ? Rest of previous dates are correct.
COQ Calendar =
var _date = date(2018,1,7)
var _st = _date +-1*if(WEEKDAY(_date)<7,WEEKDAY(_date),WEEKDAY(_date)-7)
var _cal = CALENDAR(Date(2018,1,7), TODAY()+3)
return ADDCOLUMNS( _cal
,"Year No" , QUOTIENT( DATEDIFF(Minx(_cal, [Date]), [Date], day) ,364)+1
,"Day Of Year" , Mod( DATEDIFF(Minx(_cal, [Date]), [Date], day) ,364)+1
,"Day Of Week" , Mod( DATEDIFF(Minx(_cal, [Date]), [Date], day) ,7)+1
,"Qtr" , Mod(QUOTIENT( DATEDIFF(Minx(_cal, [Date]), [Date], day) ,91),4) +1
,"Week of Month" , var _1 = mod(Mod(QUOTIENT( DATEDIFF(Minx(_cal, [Date]), [Date], day) ,7),52),13)
var _2 = if(_1=12, 5, mod(_1,4) +1)
return _2
,"Month no" , var _1 = mod(Mod(QUOTIENT( DATEDIFF(Minx(_cal, [Date]), [Date], day) ,7),52),13)
var _2 = if(_1=12, 3, QUOTIENT( _1,4) +1)
return Mod(QUOTIENT( DATEDIFF(Minx(_cal, [Date]), [Date], day) ,91),4)*3 + _2
,"Month no P" , var _1 = mod(Mod(QUOTIENT( DATEDIFF(Minx(_cal, [Date]), [Date], day) ,7),52),13)
var _2 = if(_1=12, 3, QUOTIENT( _1,4) +1)
return
IF(Mod(QUOTIENT( DATEDIFF(Minx(_cal, [Date]), [Date], day) ,91),4)*3 + _2 < 10,
"P0"& Mod(QUOTIENT( DATEDIFF(Minx(_cal, [Date]), [Date], day) ,91),4)*3 + _2,
"P"& Mod(QUOTIENT( DATEDIFF(Minx(_cal, [Date]), [Date], day) ,91),4)*3 + _2)
,"Week" , Mod(QUOTIENT( DATEDIFF(Minx(_cal, [Date]), [Date], day) ,7),52)+1
,"Week WK" , IF(Mod(QUOTIENT( DATEDIFF(Minx(_cal, [Date]), [Date], day) ,7),52)+1<10,
"WK0"& Mod(QUOTIENT( DATEDIFF(Minx(_cal, [Date]), [Date], day) ,7),52)+1,
"WK"& Mod(QUOTIENT( DATEDIFF(Minx(_cal, [Date]), [Date], day) ,7),52)+1)
,"Year" , var yearfull = QUOTIENT( DATEDIFF(Minx(_cal, [Date]), [Date], day) ,364)+1
RETURN
SWITCH(TRUE(),
yearfull = 1, 2018,
yearfull = 2, 2019,
yearfull = 3, 2020,
yearfull = 4, 2021,
yearfull = 5, 2022,
yearfull = 6, 2023,
yearfull = 7, 2024,
yearfull = 8, 2025,
yearfull = 9, 2026,
yearfull = 10, 2027,
yearfull = 11, 2028,
yearfull = 12, 2029
)
)
not clear about your request. what if we goes to the next year? always start at Jan 5th?
could you pls provide the expected output?
maybe you can put the output in an excel and upload the file.
Proud to be a Super User!
I have bit understood my needs in this case.
Week number are OK. Our financial calendar was change for 2026 and January is since week 2 to week 5.
Could you please help to tweak above code to include week 01 into 2025 year ? I have tried to read susgested links but I'm doing something wrong.
Thank you
Hi @MKPartner
To better understand Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
This is my current data:
| Year No | Day of the year | Qtr | Week of Month | Month no | Month no P | Week | Week WK | Year | WC_Month | WC_Date | Month Index (related) | Week_Value | Day of Week |
| 8 | 358 | 4 | 5 | 12 | P12 | 52 | WK52 | 2025 | grudzień 2025 | 2025P12WK52 | 2 | 1 | 1 |
| 8 | 359 | 4 | 5 | 12 | P12 | 52 | WK52 | 2025 | grudzień 2025 | 2025P12WK52 | 2 | 0 | 2 |
| 8 | 360 | 4 | 5 | 12 | P12 | 52 | WK52 | 2025 | grudzień 2025 | 2025P12WK52 | 2 | 0 | 3 |
| 8 | 361 | 4 | 5 | 12 | P12 | 52 | WK52 | 2025 | grudzień 2025 | 2025P12WK52 | 2 | 0 | 4 |
| 8 | 362 | 4 | 5 | 12 | P12 | 52 | WK52 | 2025 | grudzień 2025 | 2025P12WK52 | 2 | 0 | 5 |
| 8 | 363 | 4 | 5 | 12 | P12 | 52 | WK52 | 2025 | grudzień 2025 | 2025P12WK52 | 2 | 0 | 6 |
| 8 | 364 | 4 | 5 | 12 | P12 | 52 | WK52 | 2025 | grudzień 2025 | 2025P12WK52 | 2 | 0 | 7 |
| 9 | 1 | 1 | 1 | 1 | P01 | 1 | WK01 | 2026 | styczeń 2026 | 2026P01WK01 | 1 | 1 | 1 |
| 9 | 2 | 1 | 1 | 1 | P01 | 1 | WK01 | 2026 | styczeń 2026 | 2026P01WK01 | 1 | 0 | 2 |
| 9 | 3 | 1 | 1 | 1 | P01 | 1 | WK01 | 2026 | styczeń 2026 | 2026P01WK01 | 1 | 0 | 3 |
| 9 | 4 | 1 | 1 | 1 | P01 | 1 | WK01 | 2026 | styczeń 2026 | 2026P01WK01 | 1 | 0 | 4 |
| 9 | 5 | 1 | 1 | 1 | P01 | 1 | WK01 | 2026 | styczeń 2026 | 2026P01WK01 | 1 | 0 | 5 |
| 9 | 6 | 1 | 1 | 1 | P01 | 1 | WK01 | 2026 | styczeń 2026 | 2026P01WK01 | 1 | 0 | 6 |
| 9 | 7 | 1 | 1 | 1 | P01 | 1 | WK01 | 2026 | styczeń 2026 | 2026P01WK01 | 1 | 0 | 7 |
| 9 | 8 | 1 | 2 | 1 | P01 | 2 | WK02 | 2026 | styczeń 2026 | 2026P01WK02 | 1 | 1 | 1 |
I would like to include Week 01 which is currently in 2026 into 2025.
| Date | Year No | Day of the year | Qtr | Week of Month | Month no | Month no P | Week | Week WK | Year | WC_Month | Month Index (related) | Week_Value | Day of Week |
| 21/12/2025 | 8 | 358 | 4 | 5 | 12 | P12 | 52 | WK52 | 2025 | December 20255 | 2 | 1 | 1 |
| 22/12/2025 | 8 | 359 | 4 | 5 | 12 | P12 | 52 | WK52 | 2025 | December 2025 | 2 | 0 | 2 |
| 23/12/2025 | 8 | 360 | 4 | 5 | 12 | P12 | 52 | WK52 | 2025 | December 2025 | 2 | 0 | 3 |
| 24/12/2025 | 8 | 361 | 4 | 5 | 12 | P12 | 52 | WK52 | 2025 | December 2025 | 2 | 0 | 4 |
| 25/12/2025 | 8 | 362 | 4 | 5 | 12 | P12 | 52 | WK52 | 2025 | December 2025 | 2 | 0 | 5 |
| 26/12/2025 | 8 | 363 | 4 | 5 | 12 | P12 | 52 | WK52 | 2025 | December 2025 | 2 | 0 | 6 |
| 27/12/2025 | 8 | 364 | 4 | 5 | 12 | P12 | 52 | WK52 | 2025 | December 2025 | 2 | 0 | 7 |
| 28/12/2025 | 9 | 1 | 1 | 1 | 1 | P01 | 1 | WK01 | 2025 | December 2025 | 1 | 1 | 1 |
| 29/12/2025 | 9 | 2 | 1 | 1 | 1 | P01 | 1 | WK01 | 2025 | December 2025 | 1 | 0 | 2 |
| 30/12/2025 | 9 | 3 | 1 | 1 | 1 | P01 | 1 | WK01 | 2025 | December 2025 | 1 | 0 | 3 |
| 31/12/2025 | 9 | 4 | 1 | 1 | 1 | P01 | 1 | WK01 | 2025 | December 2025 | 1 | 0 | 4 |
| 01/01/2026 | 9 | 5 | 1 | 1 | 1 | P01 | 1 | WK01 | 2025 | December 2025 | 1 | 0 | 5 |
| 02/01/2026 | 9 | 6 | 1 | 1 | 1 | P01 | 1 | WK01 | 2025 | December 2025 | 1 | 0 | 6 |
| 03/01/2026 | 9 | 7 | 1 | 1 | 1 | P01 | 1 | WK01 | 2025 | December 2025 | 1 | 0 | 7 |
| 04/01/2026 | 9 | 8 | 1 | 2 | 1 | P01 | 2 | WK02 | 2026 | January 2026 | 1 | 1 | 1 |
since you only provide a part of your data. I am not sure how to do this for the other years.
just based on the sample data you provided.
you can try to create columns
Proud to be a Super User!
Thank you for your help. We are pretty OK. This means that 2026 year is OK as I expected, but previous year which where OK, no are NOK. Some weeks are overlapping for two months.
Screen for Feb 2026:
Screen for Feb 2025 -> week 9 in 2025 was in March 2025
Screen for March 2025 -> week 14 in 2025 was in April 2025
Actual calendar and expected in excel.
you highlighted two columns. I can find out the difference, however, can't understand the logic.
i created one column for you, pls see the attachment below.
Proud to be a Super User!
Thank you but everything was change before December 2025 in WC_Month column.
My logic is to keep everything the same since January 2018 until December 2025.
December 2025 in WC_column needs to cover WK01 in January 2026 so this still needs to be December 2025. I'd like to start with January 2026 in WC_Month column since WK02 2026 starting from Sunday 04/01/2026.
still not clear why 1/25-1/31 display 2026 Feb?
could you pls clarify this logic?
Proud to be a Super User!
Our fiscal calendar was changed on the end of last year. We are starting each week on Sunday and finish on Saturday.
In our fiscal calendar for 2026 like week 53 of 2025 but I cannot have week 53. I need to have week 01:
Our fiscal calendar:
- week 01 2026 (28/12/2025 - 03/01/2026) is still December 2025
- week 02 to week 05 - Jan 2026
- week 06 to week 09 - Feb 2026
- week 10 to week 14 - Mar 2026
- week 15 to week 18 - Apr 2026
- week 19 to week 22 - May 2026
- week 23 to week 27 - Jun 2026
- week 28 to week 31 - Jul 2026
- week 32 to week 35 - Aug 2026
- week 36 to week 40 - Sep 2026
- week 41 to week 44 - Oct 2026
- week 45 to week 48 - Nov 2026
- week 49 to week 52 - Dec 2026
pls see if this is what you want
Proud to be a Super User!
Here is excel file with calendar which exactly need with DAX.
https://www.transfernow.net/dl/20260218wiNfXESd
Thank you for support.
Hi @MKPartner
I have attached a sample PBIX that uses a financial calendar along with the DAX logic.
Hope this helps !!
Thank You.
Hi @MKPartner
Could you please let us know if any of the suggestions shared above helped to resolve the issue on your end ?
Hello, It's still not what I expected. Anywaya I have clarified fiscal calendar with Finance Team.
Everything until end of 2025 is OK. Change is applied only for first quarter of 2026. This means that first quarter is 5-4-5. Then January 2026 is starting in week 01 which is starting 28/12/2025 and finish 31/01/2025
Rest of quarters are 4-4-5:
- week 01 to week 05 - Jan 2026 - 5 weeks
- week 06 to week 09 - Feb 2026 - 4 weeks
- week 10 to week 14 - Mar 2026 - 5 weeks
- week 15 to week 18 - Apr 2026 - 4 weeks
- week 19 to week 22 - May 2026 - 4 weeks
- week 23 to week 27 - Jun 2026 - 5 weeks
- week 28 to week 31 - Jul 2026 - 4 weeks
- week 32 to week 35 - Aug 2026 - 4 weeks
- week 36 to week 40 - Sep 2026 - 5 weeks
- week 41 to week 44 - Oct 2026 - 4 weeks
- week 45 to week 48 - Nov 2026 - 4 weeks
- week 49 to week 01/2027 - Dec 2026 - 5 weeks
Hi @MKPartner
Following up to confirm if the earlier responses addressed your query by@ryan_mayu .If anything is still unclear, we’ll be happy to provide additional support.
Hi @MKPartner
Following up to confirm if the earlier responses addressed your query. If not, please share your questions and we’ll assist further.
Hi @MKPartner,
You mention that all dates prior to this are correct. The main issue is that your current code assumes that every year has exactly 364 days (52 weeks).
"Year No" = QUOTIENT( DATEDIFF(Minx(_cal, [Date]), [Date], day) ,364)+1
"Week" = Mod(QUOTIENT( DATEDIFF(Minx(_cal, [Date]), [Date], day) ,7),52)+1
``
recommended reed post by @amitchandak
Solved: Financial Year Calendar - Microsoft Fabric Community
If this response was helpful in any way, I’d gladly accept a 👍much like the joy of seeing a DAX measure work first time without needing another FILTER.
Please mark it as the correct solution. It helps other community members find their way faster (and saves them from another endless loop 🌀.
If this response was helpful in any way, I’d gladly accept a kudo.
Please mark it as the correct solution. It helps other community members find their way faster.
Connect with me on LinkedIn
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 52 | |
| 50 | |
| 34 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 93 | |
| 77 | |
| 41 | |
| 26 | |
| 26 |