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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Help please! Average Computation

Hi,

 

I need to average the rental net by month year selected. I am not getting an error but the average does not compute the way I want it to show.

 

Here is the table:

jdalfonso_0-1630393331514.png

The way dax computes average in this case is for Feb 2021 - 476,167.9 / 419 then you have average for Feb. 

If I continue, the average table will look like this:

jdalfonso_1-1630393536020.png

Overall, the average from Feb 2021 to Jul 2021 is 1,161.2. This is computed by 1,997,276.4 / 1720

 

However, the average computation that I want to see is the average of the averages.

 

Such that,

 

1136.4+1037.6+1179.8+1411.3+1392.9+232.7/6 = 1065 or the six month average of the averages.

 

Kindly take note that 6 is selected from a slicer. If I select last 12 months, it should be average of the last 12 month averages. 

 

 

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

Measures are based in context so in this case the calculation that you have is making the total has you refer, for this you need to make us of an iterator the AVERAGEX for the total line.

 

Try the following formula:

Average Total = IF(
HASONEVALUE(Table[Month Year]),
[Average_Measure],
AVERAGEX(VALUES(Table[Month Year]), [Average Measure])
)

Be aware that this may need some adjustment since I don't have any specifications about your model.

 

If this does not work can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

If the information is sensitive please share it trough private message.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @Anonymous ,

 

Measures are based in context so in this case the calculation that you have is making the total has you refer, for this you need to make us of an iterator the AVERAGEX for the total line.

 

Try the following formula:

Average Total = IF(
HASONEVALUE(Table[Month Year]),
[Average_Measure],
AVERAGEX(VALUES(Table[Month Year]), [Average Measure])
)

Be aware that this may need some adjustment since I don't have any specifications about your model.

 

If this does not work can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

If the information is sensitive please share it trough private message.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



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 MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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