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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
AliPoTD
Helper III
Helper III

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
AliPoTD
Helper III
Helper III

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

Bibiano_Geraldo
Super User
Super User

Hi @AliPoTD ,

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
    )

 

 

Is this post help you? Please consider to:

Accept as Solution!
Give a Kudo
Follow me on Linkedin

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.