cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Route217
Post Prodigy
Post Prodigy

Compare Jan 20 with Jan 21 data and work out Percentage Difference

Hi Experts

 

I want a new measure which i cannot work out on how to calculate the

Percentage Difference

Jan 2020 (441) - Jan 2021 (685) week on week comparison

 

and so on for all the months - the sample PBIX file show a measure for month over month difference. Kinldy ignore that i managed to do that.

 

See sample PBIX file.

https://www.dropbox.com/s/g50upe7c0uxozlb/Mtnovermtn.pbix?dl=0 

 

1 ACCEPTED SOLUTION
amitchandak
Super User IV
Super User IV

@Route217 , Try like

total sales same week# previous month = 
var _max = Max(DimDate[Date])
var _date = date(year(_max), month(_max)-12, Day(_max))
VAR currentyear = Year(_date)
VAR currentmonth = Month(_date)
VAR currentweeknumber = MAX(DimDate[weekinmonth])
RETURN
CALCULATE([total sales], FILTER( ALL(DimDate), DimDate[Year] = currentyear && DimDate[MonthNo] = currentmonth  && DimDate[weekinmonth] = currentweeknumber))

 

Also be careful on sort order, as you might not have prior data for 1 year. I got confused and done some reordeing

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

2 REPLIES 2
amitchandak
Super User IV
Super User IV

@Route217 , Try like

total sales same week# previous month = 
var _max = Max(DimDate[Date])
var _date = date(year(_max), month(_max)-12, Day(_max))
VAR currentyear = Year(_date)
VAR currentmonth = Month(_date)
VAR currentweeknumber = MAX(DimDate[weekinmonth])
RETURN
CALCULATE([total sales], FILTER( ALL(DimDate), DimDate[Year] = currentyear && DimDate[MonthNo] = currentmonth  && DimDate[weekinmonth] = currentweeknumber))

 

Also be careful on sort order, as you might not have prior data for 1 year. I got confused and done some reordeing

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Thank you sir

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 Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors