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
IRJ
New Member

DAX Measure for calculating the average of monthly totals

Hi All, I think this is probably a very simple question for the experts but I'm a complete newbie to DAX (and this forum) and would really appreciate your help on this.

 

A mockup of my data looks like this 

ProjectDatePersonVolume
1Feb-21Bill1.24
2Feb-21Bill0.48
3Mar-21Bill0.06
1Jul-21Bill0.87
2Jul-21Bill0.24
1Jan-21Sally0.23
2May-21Sally0.11
2Jun-21Sally0.45
3Jun-21Sally0.12
1Jun-21Fred0.06
4Jun-21Fred0.77

 

The monthly sums by person for these data are

Row LabelsJanFebMarMayJunJul
Bill 1.720.06  1.11
Sally0.23  0.110.57 
Fred    0.83 

 

I'd like to be able to calculate the average of these monthly sums. It should be 0.66. I've tried various permutations of AVERAGE function but have not been able to solve this.  I appreciate it's a basic sort of question and that I have a LOT to learn!

Thanks in advance!

1 ACCEPTED SOLUTION
v-cgao-msft
Community Support
Community Support

Hi @IRJ ,

 

Create a new measure and put it in the visual.

 

The average of monthly totals = 
VAR _total_volume=SUM('Table'[Volume])
VAR _months =DATEDIFF(MIN('Table'[Date]),MAX('Table'[Date]),MONTH)+1
RETURN
_total_volume/_months

 

The result should be like this.

vcgaomsft_0-1645518219646.png

Attach the pbix file for reference. Hope it helps.

 

Best Regards,
Community Support Team_Gao


If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

3 REPLIES 3
IRJ
New Member

very helpful replies. thank you

v-cgao-msft
Community Support
Community Support

Hi @IRJ ,

 

Create a new measure and put it in the visual.

 

The average of monthly totals = 
VAR _total_volume=SUM('Table'[Volume])
VAR _months =DATEDIFF(MIN('Table'[Date]),MAX('Table'[Date]),MONTH)+1
RETURN
_total_volume/_months

 

The result should be like this.

vcgaomsft_0-1645518219646.png

Attach the pbix file for reference. Hope it helps.

 

Best Regards,
Community Support Team_Gao


If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

amitchandak
Super User
Super User

@IRJ , You need to try a measure like

AverageX(summarize(Table, Table[Name], Table[Month], "_1", sum(Table[VOlume])), [_1])

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.