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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
IsaacH
New Member

DAX Average of Months Over Span of Years

I am looking to create a dax measure to find the average for each month over the span of many years to extrapulate seasonal trends (ex. finding the average of all January's, February's, March's, etc. from 2014-2022). 

This is my current code:

Monthly Average Industry =
var monthlytotal = SUMX(VALUES('Calendar'[MonthName]),'Sales'[Amount])
var distinctyear = DISTINCTCOUNT('Calendar'[Year])
return
    DIVIDE(monthlytotal,distinctyear)
 
Any help would be great 🙂
1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @IsaacH ,

 

try like:

Monthly Average Industry =
var monthlytotal = SUMX(VALUES('Calendar'[MonthName]), CALCULATE(SUM('Sales'[Amount])))
var distinctyear = DISTINCTCOUNT('Calendar'[Year])
return
    DIVIDE(monthlytotal,distinctyear)

View solution in original post

1 REPLY 1
FreemanZ
Super User
Super User

hi @IsaacH ,

 

try like:

Monthly Average Industry =
var monthlytotal = SUMX(VALUES('Calendar'[MonthName]), CALCULATE(SUM('Sales'[Amount])))
var distinctyear = DISTINCTCOUNT('Calendar'[Year])
return
    DIVIDE(monthlytotal,distinctyear)

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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