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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Dear all,
Could you please demonstrate me how to create an alternaticv Calender table with only Year and Week numbers:
So...
Year Weeknumber
2024 51
2024 52
2025 01
2025 02
2025 03
.. and so on.
Best regards,
Cornelis
Solved! Go to Solution.
@CornelisV Try this:
Calendar Table =
VAR __BaseTable = CALENDAR( DATE( 2024, 1, 1), DATE( 2025, 12, 31 ) )
VAR __Table =
ADDCOLUMNS(
__BaseTable,
"Year", YEAR( [Date] ),
"WeekNumber", WEEKNUM( [Date] )
)
VAR __Result = DISTINCT( SELECTCOLUMNS( __Table, "Year", [Year], "Weeknumber", [WeekNumber] ) )
RETURN
__Result
@CornelisV Try this:
Calendar Table =
VAR __BaseTable = CALENDAR( DATE( 2024, 1, 1), DATE( 2025, 12, 31 ) )
VAR __Table =
ADDCOLUMNS(
__BaseTable,
"Year", YEAR( [Date] ),
"WeekNumber", WEEKNUM( [Date] )
)
VAR __Result = DISTINCT( SELECTCOLUMNS( __Table, "Year", [Year], "Weeknumber", [WeekNumber] ) )
RETURN
__Result
Thank you for your help!
I would suggest having a full calender table, but convert the weeks I assume you have in your fact table to date. These dates could be start of end of week. This will mean you can still use time intelligence functions
Hi @Deku ,
Thank you. A full Calendar table is the best, but I have only data with weeknumers, not date 😐
Best regards
Cornelis