Sales table
Order date | Shipment date | order amount | Total order amount (running total) for June shippment for the year |
1-Jan-16 | 1-Jun-16 | 100 | 100 |
2-Feb-16 | 2-Jun-16 | 110 | 210 |
4-Feb-16 | 3-Jun-16 | 100 | 310 |
6-Feb-16 | 4-Jun-16 | 110 | 420 |
8-Feb-16 | 5-Jun-16 | 110 | 530 |
15-Mar-16 | 6-Jun-16 | 120 | 650 |
20-Apr-16 | 7-Jun-16 | 110 | 760 |
26-May-16 | 8-Jun-16 | 100 | 860 |
1-Jun-16 | 9-Jun-16 | 100 | 960 |
1-Jan-15 | 1-Jun-15 | 200 | 200 |
2-Feb-15 | 2-Jun-15 | 220 | 420 |
4-Feb-15 | 3-Jun-15 | 200 | 620 |
7-Feb-15 | 4-Jun-15 | 220 | 840 |
8-Feb-15 | 5-Jun-15 | 220 | 1060 |
17-Mar-15 | 6-Jun-15 | 240 | 1300 |
24-Apr-15 | 7-Jun-15 | 220 | 1520 |
26-May-15 | 8-Jun-15 | 200 | 1720 |
1-Jun-15 | 9-Jun-15 | 200 | 1920 |
Would like to get this result
Selected shipment month: June 2016 | |||||
Order date | Shipment month | amount | running total this year June | running total same month (which is june 2015) last year | |
1-Jan-16 | 1/06/2016 | 100 | 100 | 200 | |
2-Feb-16 | 1/06/2016 | 110 | 210 | 420 | |
4-Feb-16 | 1/06/2016 | 100 | 310 | 620 | |
6-Feb-16 | 1/06/2016 | 110 | 420 | 620 | |
7-Feb-16 | 1/06/2016 | 0 | 420 | 840 | |
8-Feb-16 | 1/06/2016 | 110 | 530 | 1060 | |
15-Mar-16 | 1/06/2016 | 120 | 650 | 1060 | |
17-Mar-16 | 1/06/2016 | 0 | 650 | 1300 | |
20-Apr-16 | 1/06/2016 | 110 | 760 | 1300 | |
24-Apr-16 | 1/06/2016 | 0 | 760 | 1520 | |
26-May-16 | 1/06/2016 | 100 | 860 | 1720 | |
1-Jun-16 | 1/06/2016 | 100 | 960 | 1920 |
My model is simple. The sales table and DimShippmentDate (joined by shipment date) and DimOrderDate (joined by Order date).
The running total this year =
calculate (sum('Sales'[amount]),
filter(all(DimOrderDate), DimOrderDate[FullDate]<=max(DimOrderDate[FullDate]))
)
nothing special here. Just typical running total calculation. Working fine.
but it is killing me to get the running total same month last year (in the case June 2015).
I tried something like this but no working
Running Total LY =
CALCULATE(sum('Sales'[amount]),
filter(all(DimOrderDate[FullDate]), DimOrderDate[FullDate]=max(DimOrderDate[FullDate])-365), filter(all(DimShippmentDate[FullDate]), year(DimShippmentDate[FullDate]) = year(max(DimShippmentDate[FullDate]))-1 && month(DimShippmentDate[FullDate]) = month(max(DimShippmentDate[FullDate])))
)
Ultimate goal is to display this year selected month (EG June 2016) and the same period last year (June 2015) shippment's running total order amount (by order date) displayed on a SAME chart for YoY comparison.
currently I can only display this year and last year running total line chart on TWO different line charts instead of ONE.
Is this even possible? If not, any workaround please?