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
Kalyani2009
Regular Visitor

previous 3 month average including january,february,march months of current year

Hello ,

I am trying to find previous 3 months of average.

I have tried below measure but I want january, february and march data aswell without selecting month and year

Measure-

 Last 3 Months =
var last_month= CALCULATE(sum(Tsales[sales]),MONTH(DimDate[Date])=MONTH(TODAY())-1)
var second_last_month=CALCULATE(sum(Tsales[sales]),
MONTH(DimDate[Date])=MONTH(TODAY())-2)
var third_last_month=CALCULATE(sum(Tsales[sales]),
MONTH(DimDate[date])=MONTH(TODAY())-3)
var total= (last_month+second_last_month+third_last_month)
var last3m_avg= (total)/3
return total
3 REPLIES 3
Cristian_Angyal
Advocate III
Advocate III

Hello @Kalyani2009 ,

 

Asuming you have a Dimension Calendar Table you could use this:

 

Prev 3 Month Average =
CALCULATE (
    AVERAGE ( Tsales[sales] ),
    DATESINPERIOD (  

       'Calendar'[Date],
        EOMONTH ( MIN ( 'Calendar'[Date] ),  -1 ),   //the last day of last month.
        -3,
        MONTH
    )
)

 

wdx223_Daniel
Super User
Super User

calculate(averagex(values(dimdate[yearmonth]),calculate(sum(tsales[sales]))),datesinperiod(eomonth(today(),-1),-3,MONTH))

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