0
votes

Im new to PowerBI and was wondering if someone could help me how to calculate a Year on year % change. I have made a measure for Total Sales in the year and Average sales Price. I would now like to calcualte the %change of the Avg sale price year on year.

Measures used:

AVG_SALE = AVERAGE([PRICE])

TOTAL_SALES = COUNT([CITY])

enter image description here

1
Could you describe the other measures that you've used? So we can help you in a better wayHenrique Branco
Hi Henrique, these are the only 2 measures ive used. CITY,TOWN,PRICE, YEAR(DATE) are all columns within my data just filtered down.Peter

1 Answers

1
votes

Use the following measure:

YoY = [AVG_SALE]/CALCULATE([AVG_SALE];SAMEPERIODLASTYEAR('yourTable'[Year]))-1

If you want to treat the possible errors (maybe you miss some years in your data, or you've got no sales on specific year):

YoY = IFERROR([AVG_SALE]/CALCULATE([AVG_SALE];SAMEPERIODLASTYEAR('tableName'[Year]))-1;BLANK())

Remember to replace tableName with the name of your table!