cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
CTan42 Helper II
Helper II

Comparison- current month vs previous month

excel.pngexcel filepowerbi.pngpower bi datareport.pngmatrix

I want to create a comparison matrix. Using the current month revenue minus previous month revenue. Is there anyway to do this?

3 ACCEPTED SOLUTIONS

Accepted Solutions
Anonymous
Not applicable

Re: Comparison- current month vs previous month

Sure there is a way! 🙂

 

You can use DAX to creat the appropriate measures to show in your matrix. See some example here: https://powerbi.tips/2016/07/measures-month-to-month-percent-change/.

 

But first you need to make sure the Date column is of Date data type - you need this in order to use Time Intelligence functions in DAX and to allow Power BI to deal with time hierarchy.

 

Hope that helps.

 

Cheers,

Pawel

View solution in original post

Anonymous
Not applicable

Re: Comparison- current month vs previous month

OK, try out this .pbix file and see if the approach used inside fits your need: http://blog.sqlgeek.pl/Download/DAX - Month over Month.pbix.

 

I used the same DAX function mentioned in the article (PREVIOUSMONTH). And presence of the regions in your data doesn't change much.

 

Cheers,

Pawel

View solution in original post

Anonymous
Not applicable

Re: Comparison- current month vs previous month

Instead of PREVIOUSYEAR use SAMEPERIODLASTYEAR function.

View solution in original post

11 REPLIES 11
Anonymous
Not applicable

Re: Comparison- current month vs previous month

Sure there is a way! 🙂

 

You can use DAX to creat the appropriate measures to show in your matrix. See some example here: https://powerbi.tips/2016/07/measures-month-to-month-percent-change/.

 

But first you need to make sure the Date column is of Date data type - you need this in order to use Time Intelligence functions in DAX and to allow Power BI to deal with time hierarchy.

 

Hope that helps.

 

Cheers,

Pawel

View solution in original post

CTan42 Helper II
Helper II

Re: Comparison- current month vs previous month

thx for the suggestion...but it doesn't work on my data...as u can see i have repeated region in every month...it is the difference between my data n your data

Anonymous
Not applicable

Re: Comparison- current month vs previous month

OK, try out this .pbix file and see if the approach used inside fits your need: http://blog.sqlgeek.pl/Download/DAX - Month over Month.pbix.

 

I used the same DAX function mentioned in the article (PREVIOUSMONTH). And presence of the regions in your data doesn't change much.

 

Cheers,

Pawel

View solution in original post

CTan42 Helper II
Helper II

Re: Comparison- current month vs previous month

@Anonymous

Thanks....It works...I have another question as well...how about if i wanna compare current month with last year month. Is there anyway to do that. I had tried the similar step.

Belows are the measurea:

Revenue LYM = CALCULATE([Revenue CM],PREVIOUSYEAR(Data[Date]))

Revenue CMvLLYM = [Revenue CM]-[Revenue LYM]

 

However it doesn't work. Can you see the problem?

Anonymous
Not applicable

Re: Comparison- current month vs previous month

Instead of PREVIOUSYEAR use SAMEPERIODLASTYEAR function.

View solution in original post

steph_io Advocate II
Advocate II

Re: Comparison- current month vs previous month

How do we have these formulas fetch the prevous month, that falls before the filtered date range (ie: date slicer)?

CTan42 Helper II
Helper II

Re: Comparison- current month vs previous month

@Anonymous hi, i have a another question. I have more 10tables like this. However, I tried to create same measures in every single table. However, it doesn't allow me to use the same name of the measure (i have to use the same name in order for presentation). Is it possible to create only one measures in one table only and it will work for every tables? 

 

Thanks.

CTan42 Helper II
Helper II

Re: Comparison- current month vs previous month

@Anonymous basically what i'm trying to say is there any other ways that can i copy and paste all of the existing measure into another table with the same name but slightly different formula. 

thanks.

DavidB
Frequent Visitor

Re: Comparison- current month vs previous month

Hello @Anonymous

 

Thank you for your contribution to this topic.

I am looking for same type of comparison, but just with current weeknum vs. previous weeknum.
I have tried Google, and there does not seem to be a PREVIOUSWEEK function like there is a PREVIOUSMONTH function you refer to.

 

How would you go about comparing week numbers?

 

Best regards
David

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Top Solution Authors
Top Kudoed Authors