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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bcsalsaboy
Regular Visitor

Calculating Year over Year change % with multiple stores showing sales in same month???

Hello everyone.  I too am a brand new user of Power BI,  less then 30 days under my belt.  Although I have been able to figure a number of things after watching the videos and seeing online help forums, I am having 1 major issue though.

I am trying to calculate YOY % change for my data   not only at my store location level, but for the total of all locations as well.   I only have year and month in my data source,   no dates (yet).  But would appreciate someone showing me how i can create the calculations or measures to get my % (using the colum header names I supplied).   Sample of my data is below.   Thank you in advance.

 

YEARMONTH SHORTCHANNEL LOCATION NAMEMONTH2Mo YRSALES
2018JANSTORE 12401JAN 201855
2018FEBSTORE 12402FEB 201883
2018MARSTORE 12403MAR 201888
2018APRSTORE 12404APR 201852
2018MAYSTORE 12405MAY 201890
2018JUNSTORE 12406JUN 2018100
2018JULSTORE 12407JUL 201873
2018AUGSTORE 12408AUG 2018113
2018SEPSTORE 12409SEP 201885
2018OCTSTORE 12410OCT 201895
2018NOVSTORE 12411NOV 2018102
2018DECSTORE 12412DEC 2018133
2019JANSTORE 12401JAN 201954
2019FEBSTORE 12402FEB 201955
2019MARSTORE 12403MAR 201938
2018JANSTORE 25001JAN 20183
2018FEBSTORE 25002FEB 20188
2018MARSTORE 25003MAR 20189
2018APRSTORE 25004APR 20185
2018MAYSTORE 25005MAY 20186
2018JUNSTORE 25006JUN 201818
2018JULSTORE 25007JUL 201810
2018AUGSTORE 25008AUG 20187
2018SEPSTORE 25009SEP 20189
2018OCTSTORE 25010OCT 20188
2018NOVSTORE 25011NOV 201812
2018DECSTORE 25012DEC 20188
2019JANSTORE 25001JAN 20194
2019FEBSTORE 25002FEB 201913
2019MARSTORE 25003MAR 20192
2018JANSTORE 400001JAN 201824
2018FEBSTORE 400002FEB 201843
2018MARSTORE 400003MAR 201846
2018APRSTORE 400004APR 201830
2018MAYSTORE 400005MAY 201844
2018JUNSTORE 400006JUN 201835
2018JULSTORE 400007JUL 201851
2018AUGSTORE 400008AUG 201850
2018SEPSTORE 400009SEP 201840
2018OCTSTORE 400010OCT 201847
2018NOVSTORE 400011NOV 201844
2018DECSTORE 400012DEC 201834
2019JANSTORE 400001JAN 201928
2019FEBSTORE 400002FEB 201936
2019MARSTORE 400003MAR 201919
2018JANSTORE 99901JAN 201890
2018FEBSTORE 99902FEB 201889
2018MARSTORE 99903MAR 2018212
2018APRSTORE 99904APR 201897
2018MAYSTORE 99905MAY 2018112
2018JUNSTORE 99906JUN 2018180
2018JULSTORE 99907JUL 2018115
2018AUGSTORE 99908AUG 2018123
2018SEPSTORE 99909SEP 2018100
2018OCTSTORE 99910OCT 2018101
2018NOVSTORE 99911NOV 2018168
2018DECSTORE 99912DEC 2018249
2019JANSTORE 99901JAN 2019112
2019FEBSTORE 99902FEB 201985
2019MARSTORE 99903MAR 2019101

 

 

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @bcsalsaboy ,

 

One sample for your reference. Please check the following steps.

 

1. Create a calcualted column in fact table.

 

 

Date = DATE(Table1[YEAR],Table1[MONTH2],1)

2. Create a  CALENDAR table and create relationship between fact table and it by the date columns.

 

 

 

CALENDAR = CALENDAR(DATE(2018,01,01),DATE(2019,12,31))

 

3. Create a measure to get the YOY.

 

Measure = DIVIDE(SUM(Table1[SALES]),CALCULATE(SUM(Table1[SALES]),SAMEPERIODLASTYEAR('CALENDAR'[Date].[Date])))

Capture.PNG

 

Regards,

Frank

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @bcsalsaboy ,

 

One sample for your reference. Please check the following steps.

 

1. Create a calcualted column in fact table.

 

 

Date = DATE(Table1[YEAR],Table1[MONTH2],1)

2. Create a  CALENDAR table and create relationship between fact table and it by the date columns.

 

 

 

CALENDAR = CALENDAR(DATE(2018,01,01),DATE(2019,12,31))

 

3. Create a measure to get the YOY.

 

Measure = DIVIDE(SUM(Table1[SALES]),CALCULATE(SUM(Table1[SALES]),SAMEPERIODLASTYEAR('CALENDAR'[Date].[Date])))

Capture.PNG

 

Regards,

Frank

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
chass
Impactful Individual
Impactful Individual

Great Reply Thom!

Chuck Sterling
TomMartens
Super User
Super User

Hey @bcsalsaboy ,

 

even if your data may not contain data that is on a day level you should consider to make it daily, e.g. just adding the 1st or last day of a month, then create a dedicated calendar table.

 

From my experience, this site https://www.daxpatterns.com/time-patterns/ contains almost everything about time intelligence calculations.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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