cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Creating a ISO week date table for academic purposes in higher education

Hello everyone!  I tried to create an academic date calendar with the WEEKNUM(DATE, 21) function and that works for the calendar year.  However, I need the first week to begin on these dates in August that are not separated by the same period of time:

(8/22/2022; 8/23/2021; 8/24/2020; 8/26/2019; 8/27/2018; 8/28/2017; 8/22/2016; 8/24/2015; 8/25/2014; 8/26/2013; 8/27/2012).

1 ACCEPTED SOLUTION
Community Support

Hi @dhall001,

You may try this solution.

Here is the sample data created from a DAX formula.

``Table = CALENDAR(DATE(2019,1,1),DATE(2022,12,31))``

Create a Calculated column to identify Academic Year.

``````First Day Of Fiscal Year =
SWITCH (
TRUE (),
'Table'[Date] >= DATE ( 2022, 8, 22 ), DATE ( 2022, 8, 22 ),
'Table'[Date] >= DATE ( 2021, 8, 23 )
&& 'Table'[Date] < DATE ( 2022, 8, 22 ), DATE ( 2021, 8, 23 ),
'Table'[Date] >= DATE ( 2020, 8, 24 )
&& 'Table'[Date] < DATE ( 2021, 8, 23 ), DATE ( 2020, 8, 24 ),
'Table'[Date] >= DATE ( 2019, 8, 26 )
&& 'Table'[Date] < DATE ( 2020, 8, 24 ), DATE ( 2019, 8, 26 ),
'Table'[Date] >= DATE ( 2018, 8, 27 )
&& DATE ( 2019, 8, 26 ), DATE ( 2018, 8, 27 )
)``````

Create another Calculated column to get Fiscal Weeks.

``````Fiscal Weeks =
var FilteredTableCount=COUNTROWS(
FILTER(
SELECTCOLUMNS(
GENERATESERIES(
'Table'[First Day Of Fiscal Year],
'Table'[Date]
),
"Dates",
[Value]
),
FORMAT([Dates],"ddd")="Thu"    //mark the first thursday of the first week as week 1
)
)
VAR WeekNos =
IF(
FORMAT('Table'[Date],"ddd") <> "Thu",
FilteredTableCount + 1,
FilteredTableCount
)
return WeekNos

``````

The result looks like this.

Also, attached the pbix file as reference.

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!

Best Regards,

Community Support Team _ Caiyun

2 REPLIES 2
Community Support

Hi @dhall001,

You may try this solution.

Here is the sample data created from a DAX formula.

``Table = CALENDAR(DATE(2019,1,1),DATE(2022,12,31))``

Create a Calculated column to identify Academic Year.

``````First Day Of Fiscal Year =
SWITCH (
TRUE (),
'Table'[Date] >= DATE ( 2022, 8, 22 ), DATE ( 2022, 8, 22 ),
'Table'[Date] >= DATE ( 2021, 8, 23 )
&& 'Table'[Date] < DATE ( 2022, 8, 22 ), DATE ( 2021, 8, 23 ),
'Table'[Date] >= DATE ( 2020, 8, 24 )
&& 'Table'[Date] < DATE ( 2021, 8, 23 ), DATE ( 2020, 8, 24 ),
'Table'[Date] >= DATE ( 2019, 8, 26 )
&& 'Table'[Date] < DATE ( 2020, 8, 24 ), DATE ( 2019, 8, 26 ),
'Table'[Date] >= DATE ( 2018, 8, 27 )
&& DATE ( 2019, 8, 26 ), DATE ( 2018, 8, 27 )
)``````

Create another Calculated column to get Fiscal Weeks.

``````Fiscal Weeks =
var FilteredTableCount=COUNTROWS(
FILTER(
SELECTCOLUMNS(
GENERATESERIES(
'Table'[First Day Of Fiscal Year],
'Table'[Date]
),
"Dates",
[Value]
),
FORMAT([Dates],"ddd")="Thu"    //mark the first thursday of the first week as week 1
)
)
VAR WeekNos =
IF(
FORMAT('Table'[Date],"ddd") <> "Thu",
FilteredTableCount + 1,
FilteredTableCount
)
return WeekNos

``````

The result looks like this.

Also, attached the pbix file as reference.

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!

Best Regards,

Community Support Team _ Caiyun

Frequent Visitor

Possible Solution:

I was thinking of using a switch true function to create academic years of the days between the dates provided above.  So, if DATE >= "2022-08-22" then "Academic Year 2022" and so forth.  Now, my thought is to create a list of 7 1's, 7 2's and for each of the given years down the column.  I know that GENERATESERIES can make series of number like 1, 2, 3, 4... down the column but I cannot find any documentation that can show how to make each value repeat 7 times down the column.  I am a little more versed in nested for and while loops which could do this iteration in other languages.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors