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

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

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

1 ACCEPTED SOLUTION
Frequent Visitor

Thanks@Interkoubess

This worked perfectly!

2 REPLIES 2
Solution Sage

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.

Let us know if you have any issues.

Ninter

Frequent Visitor

Thanks@Interkoubess

This worked perfectly!

## Helpful resources

Announcements

#### 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 Monthly Update - June 2024

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

#### New forum boards available in Real-Time Intelligence.

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

Top Solution Authors
Top Kudoed Authors