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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.

Reply
Stuznet1
Frequent Visitor

Calculate Sales from Previous Year Month to Date

Hi,

I'm struggling to get the Previous Year MTD calculation to work, and I'm trying to get the prior year month to date which is August 2021 only. How do I revise below formula for last year? 

 

This is my formula to the get the current MTD

CURRENT_MTD = CALCULATE(SUM(Data[Sales_Amount]), FILTER(Data, Data[FISCAL_DATE] >= DATE(YEAR(TODAY()), MONTH(TODAY()), 01)), FILTER(Data, Data[FISCAL_DATE] < TODAY()))

Here is the result

Capture.PNG

Thanks bunch

1 ACCEPTED SOLUTION
Stuznet1
Frequent Visitor

I figured it out myself

 

CALCULATE(SUM(Data[Sales_Amount]), 
                FILTER(Data, Data[FISCAL_DATE] <= DATE(YEAR(TODAY())-1, MONTH(TODAY()), DAY(TODAY()))),
                FILTER(Data, Data[FISCAL_DATE] >= DATE(YEAR(TODAY())-1, MONTH(TODAY()), 01)), 
                FILTER(Data, Data[FISCAL_DATE] < TODAY())
            )

Result

Capture.PNG

View solution in original post

1 REPLY 1
Stuznet1
Frequent Visitor

I figured it out myself

 

CALCULATE(SUM(Data[Sales_Amount]), 
                FILTER(Data, Data[FISCAL_DATE] <= DATE(YEAR(TODAY())-1, MONTH(TODAY()), DAY(TODAY()))),
                FILTER(Data, Data[FISCAL_DATE] >= DATE(YEAR(TODAY())-1, MONTH(TODAY()), 01)), 
                FILTER(Data, Data[FISCAL_DATE] < TODAY())
            )

Result

Capture.PNG

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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