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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
naoki
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
Anonymous
Not applicable

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.

@Anonymous  

 

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. 

Anonymous
Not applicable

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.

@Anonymous  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. 

Anonymous
Not applicable

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors