## Desktop

Frequent Visitor
Posts: 12
Registered: ‎12-13-2016

# Help :(Need to do YOY calculation, however do I need a date table to do this, is there a workaround?

I am very very new to PowerBI and I'm still getting my head around it, please pardon my ignorance

I have a data set

Shoe Type | FY13 FY14 FY15 FY16 | Total

Heels         20     30     10     50      110

Flats            5      10     20     15       50

Trainers      50     50     70    100    270

I would like to show YOY percentage growth i.e. growth from FY15 to FY16 FOR "Heels" or from FY14 TO FY15 for "trainers". My companies financial year runs from June to June. Is there a way to have the YOY calculation, so that it updates with slicer selection, however without using a calendar table? I have been trying without success to create a calendar table and I was wondering if there is a simpler way to do this and have this automatically update for selections without creating a measure for each shoe type and for each FY year.

Pangea

Accepted Solutions
Moderator
Posts: 2,588
Registered: ‎03-06-2016

## Re: Help :(Need to do YOY calculation, however do I need a date table to do this, is there a workaro

@Pangea13

In your scenario, it looks like your are using a matrix to render your data. Since you always need to compare the sales with previous year, you can create a calculated column for previous year data. I suggest you use a numeric column to store fiscal year instead of "FY xx".

```Previous Year Sales =
CALCULATE(
SUM(Table[Sales]),
FILTER(Table,
Table[Fiscal Year]=EARLIER(Table[Fiscal Year])-1 && Table[Shoe Types]=EARLIER(Table[Shoe Types])
)
)```

Then you can create your YOY calculation based on above column.

`Growth = CALCULATE(SUM(Table[Sales])-SUM(Table[Previous Year Sales]))/CALCULATE(SUM(Table[Previous Year Sales]))`

If you apply slicer for Shoe Types, this measure can be sliced with your selection as well.

Regards,

Simon Hou

All Replies
Moderator
Posts: 2,588
Registered: ‎03-06-2016

## Re: Help :(Need to do YOY calculation, however do I need a date table to do this, is there a workaro

@Pangea13

In your scenario, it looks like your are using a matrix to render your data. Since you always need to compare the sales with previous year, you can create a calculated column for previous year data. I suggest you use a numeric column to store fiscal year instead of "FY xx".

```Previous Year Sales =
CALCULATE(
SUM(Table[Sales]),
FILTER(Table,
Table[Fiscal Year]=EARLIER(Table[Fiscal Year])-1 && Table[Shoe Types]=EARLIER(Table[Shoe Types])
)
)```

Then you can create your YOY calculation based on above column.

`Growth = CALCULATE(SUM(Table[Sales])-SUM(Table[Previous Year Sales]))/CALCULATE(SUM(Table[Previous Year Sales]))`

If you apply slicer for Shoe Types, this measure can be sliced with your selection as well.

Regards,

Simon Hou

Frequent Visitor
Posts: 12
Registered: ‎12-13-2016

## Re: Help :(Need to do YOY calculation, however do I need a date table to do this, is there a workaro

Thank you Simon, really appreciate the help.