Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

DAX - Date Table - Periods/Months

Hello all, 

 

In my model with multiple tables (sales, orders, finance), I have a calendar table with date/week/month/quarter/year and financial week/period/financial year. 

Week and financial week, month and period, year and financial year don't match. 

I need to work with the financial week/period/financial year and compare this financial year to previous ones. Could you please suggest the best way to do it? 

 

Thank you. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Please refer to.

Financial Week =
VAR FirstDayOfYear =
    DATE ( YEAR ( [Date] ), 1, 1 )
VAR FiscalYearStart =
    IF (
        MONTH ( FirstDayOfYear ) >= 4,
        FirstDayOfYear,
        FirstDayOfYear - DAY ( FirstDayOfYear ) + 1 + 92
    )
VAR FiscalWeekStart =
    FiscalYearStart
        + ( WEEKDAY ( FiscalYearStart ) - 1 ) * -1
RETURN
    CEILING ( DIVIDE ( [Date] - FiscalWeekStart, 7 ), 1 )

 

Sales This Fiscal Year = CALCULATE(SUM(Sales[Amount]), FILTER(Calendar, Calendar[Financial Year] = MAX(Calendar[Financial Year])))
Sales Last Fiscal Year = CALCULATE(SUM(Sales[Amount]), FILTER(Calendar, Calendar[Financial Year] = MAX(Calendar[Financial Year]) - 1))
Fiscal Year Sales Growth = DIVIDE([Sales This Fiscal Year] - [Sales Last Fiscal Year], [Sales Last Fiscal Year])

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

Please refer to.

Financial Week =
VAR FirstDayOfYear =
    DATE ( YEAR ( [Date] ), 1, 1 )
VAR FiscalYearStart =
    IF (
        MONTH ( FirstDayOfYear ) >= 4,
        FirstDayOfYear,
        FirstDayOfYear - DAY ( FirstDayOfYear ) + 1 + 92
    )
VAR FiscalWeekStart =
    FiscalYearStart
        + ( WEEKDAY ( FiscalYearStart ) - 1 ) * -1
RETURN
    CEILING ( DIVIDE ( [Date] - FiscalWeekStart, 7 ), 1 )

 

Sales This Fiscal Year = CALCULATE(SUM(Sales[Amount]), FILTER(Calendar, Calendar[Financial Year] = MAX(Calendar[Financial Year])))
Sales Last Fiscal Year = CALCULATE(SUM(Sales[Amount]), FILTER(Calendar, Calendar[Financial Year] = MAX(Calendar[Financial Year]) - 1))
Fiscal Year Sales Growth = DIVIDE([Sales This Fiscal Year] - [Sales Last Fiscal Year], [Sales Last Fiscal Year])

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

ERD
Community Champion
Community Champion

Hi,

Try these sources:

https://www.sqlbi.com/articles/sorting-months-in-fiscal-calendars/

https://www.daxpatterns.com/custom-time-related-calculations/

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.