cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Yoy Trend by the Month

Hi, 

 

I would like to create a trend graph that shows the YoY% growth by the month over the last 12 months. The month should change automatically every Month, for example this month is Aug, so it should show Sept 2018 till Aug 2019. 

 

And the growth should be showing the growth trend to the previous year so:
Dec 2018 -> Growth from Dec 2017 and so on. 

 

I have created a YoY% Quick Measure and used this however it shows this error here. How do I solve this? 

 

Value in last 12 month = CALCULATE(SUMX(Table, Table[GP YoY%]), DATESBETWEEN(Period[Txn Month], EDATE(TODAY(), -12), TODAY()))

Capture.JPGCapture.JPG

5 REPLIES 5
Highlighted
Solution Supplier
Solution Supplier

Hi,

This is how you can do it.

1.  Create a measure to calculate the total value. For e.g

Total Sales = SUMX(Sales, Sales[Quantity] * Sales[Price] )

2. Create a measure to calculate the total value for last 12 months. For e.g

Total Sales LY = CALCULATE( [Total Sales], DATEADD( Dates[Date], -1, YEAR ))

3. Create a YoY measure

YoY Sales = 
var sale_diff = [Total Sales] - [Total Sales LY]
var yoy_sale = DIVIDE(sale_diff, [Total Sales LY], 0)
RETURN
yoy_sale

4. Show YoY measure on a visual e.g line chart against date as axis.

result.PNG

Thanks.

Highlighted

@vaibhavdesai  

 

Thank you, I have some questions. 

 

My Sales is already precalculated as numbers are taken from system, thus is there any other steps I can take? Also, how do you get the months to show up? I only managed to get the year and not month. 

 

Thank you. 

Highlighted

Hi,
We will need to create a measure for sales from predefined values.
Can you share some sample data so it is easier to work?
Thanks.
Highlighted

@vaibhavdesai  Hi, 

 

I managed to solve it, as my data has multiple slicers thus there are a lot of restrictions. 

 

But my current solution is create a quick measure for YoY%, then add in data hireachy for the axis, with my respective data needed for the legend and sales for values. 

 

After which I manually change the X Axis to show data from a predefined date. What do you think? 

 

Thank you. 

Highlighted

Can you please share your pbix and source file at OneDrive location?

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors