cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ranganna_naik
New Member

Percentage change Present month and previous month

Hi All,

 I want to calculte the previous month and present month sales . Also  i wanted to  calucate percentage change. 

 

Kindly provide me the steps or sample pbix

 

Regards,

Ranganna Naik

2 REPLIES 2
daxer
Solution Sage
Solution Sage

// Assumption is you have a custom-made calendar
// that holds the required pieces of time, among others,
// months. The Date field stores datetimes and is
// the key to the table. The table is also marked
// as the Date table in the model. Each indiviual month
// has a unique MonthId that runs from 1 to the number
// of months in the calendar (not just 12, we're talking
// about different months throughout years).

[Measure PM] =
IF( HASONEVALUE( Calendar[MonthId] ),

	CALCULATE(
		[Measure],
		DATEADD( Calendar[Date], -1, MONTH )
	)
)

[Measure MoM%] =
IF( HASONEVALUE( Calendar[MonthId] ),

	var __currentValue = [Measure]
	var __priorMonthValue = [Measure PM]
	var __delta = __currentValue - __priorMonthValue
	return
		divide(
			__delta,
			__priorMonthValue
		)
)

 

Best

D

harshnathani
Super User III
Super User III

HI @ranganna_naik ,

 

Have a look at this article

 

https://powerbi.tips/2016/07/measures-month-to-month-percent-change/

 

Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors