Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hi Everyone,
I have a table like below:
and I want to calculate MoM but my DAX for previous month's value does not work.
This is my DAX:
and here's my table result:
What's wrong with my formula? hmm
Thanks all,
Hi @orange_ ,
This my data table.
Is it necessary to achieve the following effects?
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?
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
and then joined Calendar table with column eom_date of Calendar table, but my DAX still not working
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
90 | |
82 | |
57 | |
41 | |
39 |