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
orange_
Regular Visitor

Get previous month's total value in DAX

Hi Everyone,

I have a table like below:

orange__0-1737015077015.png

and I want to calculate MoM but my DAX for previous month's value does not work. 
This is my DAX:

orange__0-1737015515665.png

orange__1-1737015178519.png

and here's my table result:

orange__2-1737015225700.png

What's wrong with my formula? hmm
Thanks all,

4 REPLIES 4
Anonymous
Not applicable

Hi @orange_ ,
This my data table.

1.png

Is it necessary to achieve the following effects? 

2.png

And this is my Dax.

TotalBuyAmount = 
CALCULATE(
    SUM('Table'[Amount]),
    'Table'[Type] = "BUY",
    ALLEXCEPT('Table', 'Table'[Month], 'Table'[Year])
)
PreviousMonthCumulative = 
CALCULATE(
    [TotalBuyAmount],
    FILTER(
        ALL('Table'),
        'Table'[Type] = "BUY" &&
        'Table'[Date] <= MAX('Table'[Date])
    )
)

You could get more detailed information by checking the attachment.

If you have any other concerns, please feel free to share with us here so that we can offer more support.!

Best regards,

Lucy Chen

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

what should I do now?

Anonymous
Not applicable

Hi @orange_ ,

Thank you for your kind reply!

Could you please provide example data or sample files here if you have any confused? We could offer you more help if we have information in detail. There is sensitive data that can be removed in advance. How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Thanks for your understanding. Your time and cooperation are much valued by us. We are looking forward to hearing from you to assist further.

Best regards,

Lucy Chen

Hi Lucy Chen,

I am very happy that you have helped me, but there are a few small mistakes here, I want to get previous month value, I'm sorry for the lack of clarity.
I added Calendar table with Date column like below

orange__0-1737085817258.png

and then joined Calendar table with column eom_date of Calendar table, but my DAX still not working

orange__1-1737086063601.pngorange__2-1737086118061.png

 

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.

Top Solution Authors
Top Kudoed Authors