Forum Discussion
Easley06
Helper II
4 years agoInserting Moving average to Visuals with Month yearly trend
hi having problem with this visual any suggestion how to insert the filter of mma 3mma 12mma
in my visual is montly share of market by company
measure:
SOM = divide(sum(mv_fact_sales_aggr[Wfactor Sales]),CALCULATE(sum(mv_fact_sales_aggr[Wfactor Sales]),ALLSELECTED(mv_fact_sales_aggr[company],mv_fact_sales_aggr[brand_family_name],mv_fact_sales_aggr[brand_name],mv_fact_sales_aggr[product_name],mv_fact_sales_aggr[volpricetier],mv_fact_sales_aggr[regional],mv_fact_sales_aggr[zone],mv_fact_sales_aggr[area],mv_fact_sales_aggr[Year],mv_fact_sales_aggr[price_segment],mv_fact_sales_aggr[Weighting Factors],mv_fact_sales_aggr[segment],mv_fact_sales_aggr[product_classifier]),ALL(mv_fact_sales_aggr[brand_family_name])),0)*100
and im using switch for my filter
measure for 3mma :
3MMA SOM = CALCULATE(AVERAGEX(values(mv_fact_sales_aggr[MonthYear]),[SOM]),DATESINPERIOD(mv_fact_sales_aggr[date],LASTDATE(mv_fact_sales_aggr[date]),-3,MONTH))
Is it possible to filter it by Moving average with a monthly chart?
3 Replies
- tamerj1
Community Champion
I don't think I fully understand your requirement. However, you may try
3MMA SOM = CALCULATE ( AVERAGEX ( SUMMARIZE ( mv_fact_sales_aggr, mv_fact_sales_aggr[company], mv_fact_sales_aggr[MonthYear] ), [SOM] ), DATESINPERIOD ( mv_fact_sales_aggr[date], LASTDATE ( mv_fact_sales_aggr[date] ), -3, MONTH ) )- Easley06
Helper II
sorry sir, is it possbile to have moving average in a monthly chart?
- tamerj1
Community Champion
Easley06
Please try3MMA SOM = VAR CurrentDate = MAX ( mv_fact_sales_aggr[date] ) VAR PreviousDate = EOMONTH ( CurrentDate, -3 ) RETURN CALCULATE ( AVERAGEX ( SUMMARIZE ( mv_fact_sales_aggr, mv_fact_sales_aggr[company], mv_fact_sales_aggr[MonthYear] ), [SOM] ), mv_fact_sales_aggr[date] <= CurrentDate, mv_fact_sales_aggr[date] > PreviousDate )