Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
YYIP54XnGbX7dvWmsI9UR5DXUuGlubpa

Monthly sales comparison selected year vs last year

I'm trying to show 2 lines in one linegraph. I would like to compare the selected years sales per month versus the precious year sales per month. Here i have a small sample of my data: 

Created AmountFcExclVat
2/20/2015 1:55:35 PM 500
5/25/2015 2:33:15 PM 400
5/26/2016 5:42:16 PM 800

 

Showing one line with sales is no problem, I put in

Dimension: Created.autoCalendar.Month

Measure: Sum(AmountFCExclVat)
This gives me a line with monthly sales, which i can filter per year by using a filter.

YYIP54XnGbX7dvWmsI9UR5DXUuGlubpa_0-1643366466608.png

What i want is the above linegraph with two lines, one line for the selected year and one line for the year previous to the selected year. What I've tried to show current year vs last year:

Dimension:
Created.autoCalendar.Month


Measure:
Sum({<Created.autoCalendar.Month= {$(=only(Created.autoCalendar.Month))}>}AmountFcExclVAT)

Sum({<Created.autoCalendar.Month= {$(=only(Created.autoCalendar.Month)-12)}>}AmountFcExclVAT)

1 Solution

Accepted Solutions
anat
Master
Master

use year field in set analysis:

current year expression  - Sum({<Year= {$(=only(year))}>}Sales)

previous year expression - Sum({<Year= {$(=only(year)-1)}>}Sales)

View solution in original post

1 Reply
anat
Master
Master

use year field in set analysis:

current year expression  - Sum({<Year= {$(=only(year))}>}Sales)

previous year expression - Sum({<Year= {$(=only(year)-1)}>}Sales)