Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
tanna-manohar-e
New Member

how to calculate the difference between the current month's sales and the previous month's sales

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?

3 ACCEPTED SOLUTIONS
Anand24
Super User
Super User

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 !!!
LinkedIn

View solution in original post

MasonMA
Community Champion
Community Champion

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).

 

View solution in original post

Abhilash_P
Power Participant
Power Participant

Hi @tanna-manohar-e 
Below are the measures you need:

1. Calculate Previous Month Sales

Sales Previous Month =
CALCULATE(
    SUM(Sales[SalesAmount]),
    DATEADD('Calendar'[Date], -1, MONTH)
)

2. Calculate the MoM Difference

Subtract the previous month from the current sales (assuming you already have a Total Salesmeasure):

 
MoM Sales Difference =
[Total Sales] - [Sales Previous Month]

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

You may also want to explore visual calculations.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Abhilash_P
Power Participant
Power Participant

Hi @tanna-manohar-e 
Below are the measures you need:

1. Calculate Previous Month Sales

Sales Previous Month =
CALCULATE(
    SUM(Sales[SalesAmount]),
    DATEADD('Calendar'[Date], -1, MONTH)
)

2. Calculate the MoM Difference

Subtract the previous month from the current sales (assuming you already have a Total Salesmeasure):

 
MoM Sales Difference =
[Total Sales] - [Sales Previous Month]
MasonMA
Community Champion
Community Champion

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).

 

Anand24
Super User
Super User

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 !!!
LinkedIn

Helpful resources

Announcements
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.