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 August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Calculate average using month instead total count

Hi ,  I am trying to  get  Month differnce values  based total value average . when  i created average dax measure  after that applied in table . getting error.

 

i have attached sample PBI file 

Sample File 

 

In excel sheet i have totally   8  count and total actuals value  17,377.944  .  its average as per the excel 

= 17.377.944 / 8

 

avg = 643.62.

instead of i am want get average  total month.   i am used below measure 

 

avg val = CALCULATE(SUM(Sheet1[Actuals]),FILTER(Sheet1,Sheet1[Year]="2020"))/12

please find the below screen shot .

 

 

THENNA_41_3-1641476844011.png

i am to  avg total value used all month like below 

 

THENNA_41_4-1641477174550.png

 

 

My formula 

 

avg= calcuilate (SUM(Sheet1[actuals] - sheet[avg val]))/ Sheet1[actuals] 

 

 

 

why i am getting every month different  value  , want use total avg for all month . looking for support,. thanks in advance 

 

 

 

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Try this,

DAX code:

test1 = 
    var _totalEachYear= CALCULATE( SUM(Sheet1[Actuals]),ALLEXCEPT(Sheet1,Sheet1[Year]))
return 
    IF(SUM(Sheet1[Actuals])>0,DIVIDE(_totalEachYear,12))

vxiaotang_0-1641882091392.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

4 REPLIES 4
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Try this,

DAX code:

test1 = 
    var _totalEachYear= CALCULATE( SUM(Sheet1[Actuals]),ALLEXCEPT(Sheet1,Sheet1[Year]))
return 
    IF(SUM(Sheet1[Actuals])>0,DIVIDE(_totalEachYear,12))

vxiaotang_0-1641882091392.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.

Anonymous
Not applicable

@v-xiaotang  thank  you so much. its working 

Anonymous
Not applicable

@amitchandak  i am getting Error sir in above measure 

amitchandak
Super User
Super User

@Anonymous , Try a measure like

CALCULATE(averageX(summarize(Sheet1, Sheet1[Year],Sheet1[Month], "_1", SUM(Sheet1[Actuals]),FILTER(Sheet1,Sheet1[Year]="2020")) ), [_1])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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