Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
My table appears to have contiguous dates. I am trying to compare the sum of charges from my current month as of a specific date to a prior month for the same time frame. For example, I want to compare charges from 11/1 - 11/21 to prior month 10/1 - 10/21. My date add function is returning the sum for all dates in my prior month (10/1 - 10/31). Not sure how to get around this. Any help would be appreciated.
Solved! Go to Solution.
Thanks for your responses! I was able to find the solution to my formula. I was not using the ENDOFMONTH function which was causing the problem. My formula is shown below. It is now working appropriately, and giving me the prior month MTD charges comparable to the date in the current month I am viewing. Eg. Nov 15 MTD charges are now comparable to Oct 15 MTD charges. Keep in mind that this formula only produces charges as of the current month end date. So if you had total charges for the month of September as of 9/30, it would only give you comparable charges as of 8/30 (not for the full month of August). However, if I did have total charges as of 7/31, it would produce for the previous month, total MTD charges as of 6/30.
PrevMTDCharges = TOTALMTD([TotalCharges],DATEADD(ENDOFMONTH('Calendar'[Date]),-1,MONTH))
Thanks for your responses! I was able to find the solution to my formula. I was not using the ENDOFMONTH function which was causing the problem. My formula is shown below. It is now working appropriately, and giving me the prior month MTD charges comparable to the date in the current month I am viewing. Eg. Nov 15 MTD charges are now comparable to Oct 15 MTD charges. Keep in mind that this formula only produces charges as of the current month end date. So if you had total charges for the month of September as of 9/30, it would only give you comparable charges as of 8/30 (not for the full month of August). However, if I did have total charges as of 7/31, it would produce for the previous month, total MTD charges as of 6/30.
PrevMTDCharges = TOTALMTD([TotalCharges],DATEADD(ENDOFMONTH('Calendar'[Date]),-1,MONTH))
Thanks! You solved an issue I was having!
You must have a seperate date table for DATEADD to work correctly. If you are pulling your dates from your fact table you will encounter errors. All Time intelligence calculations require a seperate date dimension table.
See this link for more information:
https://www.sqlbi.com/articles/time-intelligence-in-power-bi-desktop/
Proud to be a Super User!
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 38 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 68 | |
| 66 | |
| 29 | |
| 26 | |
| 25 |