Quantcast
Channel: Developer topics
Viewing all articles
Browse latest Browse all 18015

Calculate past 5 week Average

$
0
0

I was trying to generate a 5-week average volume. Does anyone know why the first formula work but not the second one? 

 

Vol Avg5WK = calculate(Divide(SUM('2014Data'[#Shipments]),5),FILTER(all('2014Data'),'2014Data'[WeekNum]>=MAX('2014Data'[WeekNum])-5 && '2014Data'[WeekNum]<=MAX('2014Data'[WeekNum])-1))

 

Vol Avg5WK = calculate(Divide(SUM('2014Data'[#Shipments]),5),FILTER('2014Data','2014Data'[WeekNum]>=MAX('2014Data'[WeekNum])-5 && '2014Data'[WeekNum]<=MAX('2014Data'[WeekNum])-1))

 

The difference is I removed All() from Filter function.

 

Many thanks!

 

 


Viewing all articles
Browse latest Browse all 18015

Trending Articles



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