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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
arvindyadav
Post Partisan
Post Partisan

How to extract previous months week value and current months 1st week value

Hi Team,

 

I am struggling with some query i.e

I want to compare previous months date like 1st January 2018 to 8th January 2018 from 1st January 2018 to 8th January 2018 sale difference in percentage.

 

i.e, basically I want date to date comparison of my sales in the field.

i.e, Suppose  I incur 2lakhs in 1st January 2018 and 5 Lakhs in 1st February 2018  what is % change between this date.

So how to extract dates from date column and compare this please explain.

Thanking You!!!

 

 

Regards,

Arvind.

1 ACCEPTED SOLUTION

@arvindyadav,

 

Try this,

 

Variance% =

VAR __PREV_MONTH = CALCULATE(SUM('Sales'[Value]), DATEADD('Sales'[Date], -1, MONTH))
RETURN
DIVIDE(SUM('Sales'[Value]) - __PREV_MONTH, __PREV_MONTH)

 

 

View solution in original post

10 REPLIES 10
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @arvindyadav,

For Month to Month Percent Change, please see an example in this blog: Measures – Month to Month Percent Change.

Best Regards,
Angelia

Hi @angelia,

 

The link that you shared it is not working. Please, can you suggest any dax for the same?

 

Regards, 

Arvind

@arvindyadav,

 

Try this,

 

Variance% =

VAR __PREV_MONTH = CALCULATE(SUM('Sales'[Value]), DATEADD('Sales'[Date], -1, MONTH))
RETURN
DIVIDE(SUM('Sales'[Value]) - __PREV_MONTH, __PREV_MONTH)

 

 

Hi @SivaMani,

 

In your case can you please suggest me how to first find previous month value and then I will apply the Dax formula that was you provided to me.

 

Regards,

Arvind.

CALCULATE(SUM('Sales'[Value]), DATEADD('Sales'[Date], -1, MONTH))

Hi @SivaMani,

 

The formula given by you for the previous month is not working.

Please find attached file.

 

Regards,

Arvind.CAN'T SEE THE VISUAL.png

Thanks @SivaMani .

Hi @SivaMani,

 

Got answer thank you so much.

Last doubt how you got _PREV_MONTH in this formula.

Variance% =

VAR __PREV_MONTH = CALCULATE(SUM('Sales'[Value]), DATEADD('Sales'[Date], -1, MONTH))
RETURN
DIVIDE(SUM('Sales'[Value]) - __PREV_MONTH, __PREV_MONTH)

 

Regards,

Arvind

CALCULATE has two parts,

  1. Expression
  2. Filters

The expression will be evaluated based on the filters. In this case, DATEADD will give me previous month date. So, CALCULATE will give me the value of the previous month.

 

That's how it works.

 

It's working fine for me.

 

Can you share the error details?

 

If possible, share the pbix as well.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors