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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
JamilESpencer
Frequent Visitor

YOY Calculation on Sale Data Across multiple periods

 

 

 

Hello Everyone,

 

I am trying to figure out how to calculate YOY. My issue is, in excel I create a pivot to summarize annual sales and on the worksheet I would calcuate the YOY using  (Previous Sales - New Sales)/Previous Sales. However, since I can't edit the visual like I do in excel, I would perform this action in the query table. Below is a snap shot of the data in my table; I need to be able to do calculate YOY at the "Product" level; assuming this will filter down to the Item Name when I create the filters in my visual

 

 

DOCDATEITEMNAMELINE AMOUNT FCProduct
2014-10-02  Chicken  20/0.5 lb$0.00Product A
2015-02-11  Chicken  20/0.5 lb$0.00Product A
2015-03-25  Chicken  20/0.5 lb$0.00Product A
2016-03-07  Chicken  20/0.5 lb$0.00Product A
2016-10-12  Chicken  20/0.5 lb$0.00Product A
2014-01-03  Chicken  4/6 lb$393.20Product A
2014-03-19  Chicken  4/6 lb$436.45Product A
2014-10-02  Chicken  4/6 lb$436.45Product A
2015-02-11  Chicken  4/6 lb$898.80Product A
2015-06-25  Chicken  4/6 lb$560.18Product A
2015-08-24  Chicken  4/6 lb$590.93Product A
2015-11-06  Chicken  4/6 lb$597.24Product A
2015-12-31  Chicken  4/6 lb$0.00Product A
2015-12-31  Chicken  4/6 lb$0.00Product A
2015-12-31  Chicken  4/6 lb$627.82Product A
2015-12-31  Chicken  4/6 lb$627.82Product A
2016-03-07  Chicken  4/6 lb$1,209.92Product A
2016-05-13  Chicken  4/6 lb$583.26Product A
2016-07-26  Chicken  4/6 lb$599.92Product A
2016-10-12  Chicken  4/6 lb$600.56Product A
2014-01-03  Chicken  3/12 lb$862.08Product A
2014-10-02  Chicken  3/12 lb$478.45Product A
2014-12-03  Chicken  3/12 lb$472.08Product A
2015-02-11  Chicken  3/12 lb$472.08Product A
2015-03-25  Chicken  3/12 lb$472.08Product A
2015-06-25  Chicken  3/12 lb$588.45Product A
2015-08-24  Chicken  3/12 lb$620.75Product A
2015-11-06  Chicken  3/12 lb$614.40Product A
2015-12-31  Chicken  3/12 lb$0.00Product A
2015-12-31  Chicken  3/12 lb$0.00Product A


 

1 ACCEPTED SOLUTION

Thanks@Interkoubess

 

This worked perfectly!

View solution in original post

2 REPLIES 2
Interkoubess
Solution Sage
Solution Sage

Hi @JamilESpencer,

 

Please add a calendar Table to your model if you don<t have one and link it to your table by date (DOCDATE).

Then create your measure as you want for example ( I called my table Data):


Sales = CALCULATE(SUM(Data[LINE AMOUNT FC])) Sales LY = CALCULATE([Sales],PREVIOUSYEAR('Calendar'[Date]))
 

and you can perform any measures you want. 

 

tests.PNG

Let us know if you have any issues.

 

Ninter

Thanks@Interkoubess

 

This worked perfectly!

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.