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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Easley06
Helper II
Helper II

Getting previous 3MMA

Hi,

 

can someone help me to figure out how to get this?

currently i have 3MMA but how to get Jan 2022 and Nov, Dec 2021

Easley06_0-1650434958717.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))
 
 
Thanks.
1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @Easley06 ,

Please enable the Time Intelligence. This will let the data column has Date Hierarchy.

vchenwuzmsft_0-1650619447607.png

 

Create a measure via the expression below.

Measure =
CALCULATE (
    AVERAGE ( 'Table'[Values] ),
    FILTER ( 'Table', [Date] >= DATE(YEAR(TODAY()),MONTH(TODAY())-5,1) )
)

This measure will filter the context and if the context have no rows match the condition, it will return blank.

Result:

vchenwuzmsft_1-1650619584070.png

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-chenwuz-msft
Community Support
Community Support

Hi @Easley06 ,

Please enable the Time Intelligence. This will let the data column has Date Hierarchy.

vchenwuzmsft_0-1650619447607.png

 

Create a measure via the expression below.

Measure =
CALCULATE (
    AVERAGE ( 'Table'[Values] ),
    FILTER ( 'Table', [Date] >= DATE(YEAR(TODAY()),MONTH(TODAY())-5,1) )
)

This measure will filter the context and if the context have no rows match the condition, it will return blank.

Result:

vchenwuzmsft_1-1650619584070.png

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

tamerj1
Super User
Super User

@Easley06 

Doupt it works properly without Date table but you may try

Previous 3MMA SOM =
CALCULATE (
    AVERAGEX ( VALUES ( mv_fact_sales_aggr[MonthYear] ), [SOM] ),
    DATESINPERIOD (
        mv_fact_sales_aggr[date],
        DATEADD ( LASTDATE ( mv_fact_sales_aggr[date] ), -3, MONTH ),
        -3,
        MONTH
    )
)

it works but i have year for 2022 and i want to get also the Nov , Dec 2021 and Jan 2022 is it possible? 

Easley06_0-1650423890903.png

Easley06_1-1650423925449.png

 

 

@Easley06 
Sorry, can you please clarify further?

Hi sir,

what i mean is i have 2022 data whice has 4months and i like to get also the previous 3MMA

currently the measure you gave only works if quarter is complete

Easley06_1-1650434862229.png

would like to get the jan 2022 , Dec and nov 2021 

 

@Easley06 

Any chance you can share sample file?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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