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
nmanselmo
Frequent Visitor

YoY Measure showing only final

Hello All! First post, excited to join community.

 

I have the following data set and I am trying to add a new measure to the very right hand side calculating the Margin Growth. Any ideas? 

Capture.PNG

 

 

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

=IF(ISERROR(CALCULATE([Gross Margin],NEXTYEAR(Calendar[Year]))),([Gross Margin]-CALCULATE([Gross Margin],PREVIOUSYEAR

(Calendar[Year])))/[Gross Margin],BLANK())

 

Ensure that the years in your visual are dragged from the calendar table and there is a relationship between the Date column of your source data table to the date column of your calendar table.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

=IF(ISERROR(CALCULATE([Gross Margin],NEXTYEAR(Calendar[Year]))),([Gross Margin]-CALCULATE([Gross Margin],PREVIOUSYEAR

(Calendar[Year])))/[Gross Margin],BLANK())

 

Ensure that the years in your visual are dragged from the calendar table and there is a relationship between the Date column of your source data table to the date column of your calendar table.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
jmalone
Resolver III
Resolver III

Basic pattern for YoY measure would be:

 

Margin Growth = [Gross Margin] - CALCULATE( [Gross Margin] , DATEADD('Date'[Date], -1, YEAR) )

Where 'Date'[Date] is a column of type = Date with a continuous and unique instance for each day (ie exactly one day for every day of the year). You must have a relationship between this Date table and your FACT table.

 

 

In your example table visual you show both 2016 and 2017. If you use the above measure, you will see Margin Growth for both years. The column within 2017 will show (2017 - 2016), and the 2016 column will show [Gross Margin] for (2016 - 2015).

 

Thanks. I did get this far...in terms of the calculation itself. I was trying to figure out how to do this formula on this type of table shown above while not showing the 2016 value, only the 2017 value. Hope this make sense.
TomMartens
Super User
Super User

Hey,

 

welcome to the community.

 

It would be helpful if you could provide the measure you are using to calculate the YoY Growth.

 

This side provides valueable insights into almost any date calculation:

http://www.daxpatterns.com/time-patterns/

 

Hope this gets you started

 

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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.