Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Easley06
Helper II
Helper II

Inserting 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

Easley06_2-1650254965100.png

 and im using switch for my filter 

Easley06_3-1650255018603.png

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 3
tamerj1
Super User
Super User

@Easley06 

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
    )
)

sorry sir, is it possbile to have moving average in a monthly chart?

@Easley06 
Please try

3MMA 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
    )

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors