Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hey everyone,
How to calculate the difference between the current month's sales and the previous month's sales in a table visualization.
My data model is simple (just aSales table and a Calendartable linked by Date).
What's the easiest DAX measure to show the MoM (Month-over-Month) sales difference?
Solved! Go to Solution.
Hi @tanna-manohar-e,
You can use below DAX in a calculated measure for MoM sales difference:
MoM Sales Difference =
VAR CurrMonth = SUM(TableName[Sales])
VAR PrevMonth = CALCULATE(SUM(TableName[Sales]), DATEADD('Date'[Date], -1, MONTH))
RETURN CurrMonth - PrevMonth
If you need MoM Sales %Change, you can use the below:
MoM Sales %Change=
VAR CurrMonth = SUM(TableName[Sales])
VAR PrevMonth = CALCULATE(SUM(TableName[Sales]), DATEADD('Date'[Date], -1, MONTH))
RETURN DIVIDE(CurrMonth - PrevMonth, PrevMonth)
Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!! Proud To Be a Super User !!! |
Hi,
In addition, to use DATEADD() to shift context backward by 1 month and achieve the expected result, you would first make sure your Calendar table is a proper continuous 'Date table' and your visual uses a field from the Calendar table on rows/columns (for example Year-Month).
Hi @tanna-manohar-e
Below are the measures you need:
Sales Previous Month =
CALCULATE(
SUM(Sales[SalesAmount]),
DATEADD('Calendar'[Date], -1, MONTH)
)Subtract the previous month from the current sales (assuming you already have a Total Salesmeasure):
MoM Sales Difference = [Total Sales] - [Sales Previous Month]
Hi,
You may also want to explore visual calculations.
Hi @tanna-manohar-e
Below are the measures you need:
Sales Previous Month =
CALCULATE(
SUM(Sales[SalesAmount]),
DATEADD('Calendar'[Date], -1, MONTH)
)Subtract the previous month from the current sales (assuming you already have a Total Salesmeasure):
MoM Sales Difference = [Total Sales] - [Sales Previous Month]
Hi,
In addition, to use DATEADD() to shift context backward by 1 month and achieve the expected result, you would first make sure your Calendar table is a proper continuous 'Date table' and your visual uses a field from the Calendar table on rows/columns (for example Year-Month).
Hi @tanna-manohar-e,
You can use below DAX in a calculated measure for MoM sales difference:
MoM Sales Difference =
VAR CurrMonth = SUM(TableName[Sales])
VAR PrevMonth = CALCULATE(SUM(TableName[Sales]), DATEADD('Date'[Date], -1, MONTH))
RETURN CurrMonth - PrevMonth
If you need MoM Sales %Change, you can use the below:
MoM Sales %Change=
VAR CurrMonth = SUM(TableName[Sales])
VAR PrevMonth = CALCULATE(SUM(TableName[Sales]), DATEADD('Date'[Date], -1, MONTH))
RETURN DIVIDE(CurrMonth - PrevMonth, PrevMonth)
Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!! Proud To Be a Super User !!! |
| User | Count |
|---|---|
| 51 | |
| 38 | |
| 33 | |
| 22 | |
| 19 |
| User | Count |
|---|---|
| 136 | |
| 101 | |
| 58 | |
| 36 | |
| 35 |