Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi there
I have 3 columns of data 'Date', 'Institution', and 'Sales'. I am wanting to calculate a measure that give the year on year % change in sales for each institution.
I have been using quick measure for year over year change functin for aggregate sales, but having an issue with finding code that incorporates another column, (i.e. instituion) so as to present % changes for each institution year on year.
Solved! Go to Solution.
Hi,
The general structure for YoY % change calculations is as follows:
VAR LastYear = CALCULATE ( selectedmeasure(), SAMEPERIODLASTYEAR ( 'Calendar'[Date] ) ) RETURN DIVIDE(selectedmeasure()-LastYear,LastYear)
This is an calculation group example so replace "selectedmeasure" with yout calculation logic. So for example something like SUM('Sales'[values]). If your Sales table has a relationship to 'instittututions' and 'calendar' this code should also account for those dimensions.
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
Proud to be a Super User!
Thanks for your response. Although this calculation is returning all YoY% figures as 0.00%.
This is the code I used.
Hi,
The general structure for YoY % change calculations is as follows:
VAR LastYear = CALCULATE ( selectedmeasure(), SAMEPERIODLASTYEAR ( 'Calendar'[Date] ) ) RETURN DIVIDE(selectedmeasure()-LastYear,LastYear)
This is an calculation group example so replace "selectedmeasure" with yout calculation logic. So for example something like SUM('Sales'[values]). If your Sales table has a relationship to 'instittututions' and 'calendar' this code should also account for those dimensions.
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
Proud to be a Super User!
Thanks for your response ValtteriN. Although this calculation is returning all YoY% figures as 0.00%.
This is the code I used.
User | Count |
---|---|
13 | |
8 | |
8 | |
7 | |
5 |
User | Count |
---|---|
23 | |
15 | |
15 | |
10 | |
7 |