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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Comparing data with previous financial year

Hello all,

 

I have been asked to adapt an existing report which was using calendar dates to one that uses our company's Financial Years and Financial Weeks.

 

We have a table which shows a column with the number of orders per calendar month, and another column with the number of orders from the same month for the previous year. For this, I used:

CALCULATE(SUM('Orders'[Order Qty]), SAMEPERIODLASTYEAR('Calendar'[Date]) )
 
I now need to change this so that it sums the order quantities taken in the same financial week but for the previous financial year. As the "SAMEPERIODLASTYEAR" only works for dates, I'm unsure how to get a measure to give me the data I need. Can anyone help please?

 

I have the following data Table A:

FYFY WeekNumCustomer NumberOrders
2023110418,026
2023210424,941
2023310419,161
2024110416,831
2024210422,954
2024310418,977

 

 

I need to have a table visual which shows the following:

FYFY WeekNumCustomer NumberOrderPrevious FY
2024110416,83118,026
2024210422,95424,941
2024310418,97719,161

 

How can I achieve this please? Any help really appreciated.

 

Many thanks,

Alison

1 ACCEPTED SOLUTION
shreebidwai
Frequent Visitor

  • Data Model Preparation:
    • Ensure your data includes a Financial Year (FY) and Financial Week (FY WeekNum) columns. These will replace the calendar dates for your calculations.
  • Create a Measure for Current FY Orders: This sums up orders for the current FY and Week:

    DAX
    Copy code
    Current FY Orders =
    SUM('Table A'[Orders])
  • Create a Measure for Previous FY Orders: Use DAX to calculate orders for the same week in the previous financial year:

    DAX
    Copy code
    Previous FY Orders =
    CALCULATE(
        SUM('Table A'[Orders]),
        FILTER(
            'Table A',
            'Table A'[FY] = EARLIER('Table A'[FY]) - 1 &&
            'Table A'[FY WeekNum] = EARLIER('Table A'[FY WeekNum])
        )
    )

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Thanks so much for the clear explanation, much appreciated! 🙂

Bibiano_Geraldo
Super User
Super User

Hi @Anonymous ,

If i understood well, please try the bellow DAX measure:

Orders Previous FY = 
VAR CurrentFY = MAX('Table A'[FY])
VAR CurrentWeekNum = MAX('Table A'[FY WeekNum])
VAR PreviousFY = CurrentFY - 1
RETURN
    CALCULATE(
        SUM('Table A'[Orders]),
        'Table A'[FY] = PreviousFY,
        'Table A'[FY WeekNum] = CurrentWeekNum
    )

 

 

shreebidwai
Frequent Visitor

  • Data Model Preparation:
    • Ensure your data includes a Financial Year (FY) and Financial Week (FY WeekNum) columns. These will replace the calendar dates for your calculations.
  • Create a Measure for Current FY Orders: This sums up orders for the current FY and Week:

    DAX
    Copy code
    Current FY Orders =
    SUM('Table A'[Orders])
  • Create a Measure for Previous FY Orders: Use DAX to calculate orders for the same week in the previous financial year:

    DAX
    Copy code
    Previous FY Orders =
    CALCULATE(
        SUM('Table A'[Orders]),
        FILTER(
            'Table A',
            'Table A'[FY] = EARLIER('Table A'[FY]) - 1 &&
            'Table A'[FY WeekNum] = EARLIER('Table A'[FY WeekNum])
        )
    )

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.