Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 213819

Running total YoY - Dax experts needed

$
0
0

Sales table

Order dateShipment dateorder amountTotal order amount (running total) for June shippment for the year
1-Jan-161-Jun-16100100
2-Feb-162-Jun-16110210
4-Feb-163-Jun-16100310
6-Feb-164-Jun-16110420
8-Feb-165-Jun-16110530
15-Mar-166-Jun-16120650
20-Apr-167-Jun-16110760
26-May-168-Jun-16100860
1-Jun-169-Jun-16100960
1-Jan-151-Jun-15200200
2-Feb-152-Jun-15220420
4-Feb-153-Jun-15200620
7-Feb-154-Jun-15220840
8-Feb-155-Jun-152201060
17-Mar-156-Jun-152401300
24-Apr-157-Jun-152201520
26-May-158-Jun-152001720
1-Jun-159-Jun-152001920

 

Would like to get this result

 

Selected shipment month: June 2016    
Order dateShipment monthamountrunning total this year Junerunning total same month (which is june 2015) last year
1-Jan-161/06/2016100100200 
2-Feb-161/06/2016110210420 
4-Feb-161/06/2016100310620 
6-Feb-161/06/2016110420620 
7-Feb-161/06/20160420840 
8-Feb-161/06/20161105301060 
15-Mar-161/06/20161206501060 
17-Mar-161/06/201606501300 
20-Apr-161/06/20161107601300 
24-Apr-161/06/201607601520 
26-May-161/06/20161008601720 
1-Jun-161/06/20161009601920 

 

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?

 


Viewing all articles
Browse latest Browse all 213819

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>