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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
JB17
Frequent Visitor

DAX Formula

hi, good day! I'm newbie to powerbi. Can someone help me with DAX formula? I was trying to get the average per month wherein there are four scores per month. Similar to below table but for 12 months.

 

JB17_0-1653976614307.png

 

Would really appreciate your help! Thanks in advance!

 

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @JB17 

You can try this,

average = 
var _date= MIN('Table'[Date])
return AVERAGEX(FILTER(ALL('Table'),YEAR( 'Table'[Date])= YEAR(_date) && MONTH('Table'[Date])= MONTH(_date)),[Score])

result

vxiaotang_0-1654245226634.png

Best Regards,

Community Support Team _Tang

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

View solution in original post

3 REPLIES 3
v-xiaotang
Community Support
Community Support

Hi @JB17 

You can try this,

average = 
var _date= MIN('Table'[Date])
return AVERAGEX(FILTER(ALL('Table'),YEAR( 'Table'[Date])= YEAR(_date) && MONTH('Table'[Date])= MONTH(_date)),[Score])

result

vxiaotang_0-1654245226634.png

Best Regards,

Community Support Team _Tang

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

ValtteriN
Super User
Super User

Hi,

You can create a relationship between your fact table and calendar table and then use DAX similar to this:

Monthly average =
var _year = YEAR(MAX('Calendar'[Date]))
var _month = MONTH(MAX('Calendar'[Date]))
return

CALCULATE(AVERAGE(Aggregation[Duration(Secs)]),ALL('Calendar'[Date]),
'Calendar'[Year]=_year,
'Calendar'[Month]=_month)


Here we use ALL to remove date filter and then use variables to return the context on month and year level. By doign this we can get monthly averages.

ValtteriN_0-1653981703830.png

 




I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




tamerj1
Super User
Super User

Hi @JB17 
Please provide more details about your source data. It really depends

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.