Forum Discussion
Running Sum Formula Not Working
- 1 year ago
Hi,
No, we decided to go with different approach and not calculate this in Power BI. I believe that there is an issue with the data and this is why the formulas are not working.
Thank you!
Hi GosiaPio2506 ,
Thank you for reaching out to the Microsoft Fabric Community Forum.
I've reviewed your issue and can confirm that johnt75 guidance is correct.
The main issue with your original formula is the use of the NetAmount variable. In DAX, variables are static within their evaluation context and do not dynamically respond to changes in filter context when used inside a CALCULATE function. Consequently, defining NetAmount outside of CALCULATE prevents it from being influenced by the date filters applied within.
The corrected formula suggested by the Super User resolves this by placing SUM('Sales'[Net Amount]) directly inside the CALCULATE function. This ensures the expression is dynamically evaluated based on the date range filters, accurately reflecting the running total for the 3-month period prior to the current month.
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thankyou.