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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
IsaacH
Regular Visitor

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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