Forum Discussion
Anonymous
8 years agoNot applicable
Add monthly average to a daily visual
Hi I need to add data labels with monthly average to this serie. The visual represents daily values but my client wants only the monthly ones on it. Do you have any idea? Regards
Anonymous
8 years agoNot applicable
You may need a measure for this, like :
# Orders last 30 days =
CALCULATE (
COUNT ( 'Orders'[OrderKey] ) / 30;
USERELATIONSHIP ( 'Date'[Date]; 'Orders'[Date] );
DATESINPERIOD ( 'Date'[Date]; LASTDATE ( 'Orders'[Date] ); -30; DAY )
Anonymous
8 years agoNot applicable
Sorry Anonymous, but... what happens with 28, 29 and 31 days months?
Thanks
- Anonymous8 years agoNot applicable
It was an example how to calculate average over x days. For months you can use something like:
AvgLast1Month = CALCULATE(AVERAGE(Orders[amount]),DATESINPERIOD(Orders[Date],LASTDATE(Orders[Date]),-1,MONTH))/1
AvgLast3Months = CALCULATE(AVERAGE(Orders[amount]),DATESINPERIOD(Orders[Date],LASTDATE(Orders[Date]),-3,MONTH))/3
etc.
Hope this will help you.
Kind regards