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
rssvlk
Frequent Visitor

Average of Category Averages as a Measure

Can I create a Measure to average 'HydroVu Data'[value] for each 'SiteLocation'[name] with the last 24 hours and then take the average fo these averages? So the result would be a single number that describes the average, but isn't weighted in favor of SiteLocations with more data points.

 

So filter by DateTimeGMT, then get these averages grouped by SiteLocation[name] and then get the final average of those averages.

rssvlk_0-1634828341827.png

rssvlk_1-1634828414200.png

 

I looked at these and couldn't quite make sense of it:

https://community.powerbi.com/t5/Desktop/AS-AVERAGED-BY-A-CATEGORY/m-p/2057995#M768836

https://community.powerbi.com/t5/Desktop/Calculate-Average-per-category/m-p/362637#M163818

 

Thanks for any help!

 

 

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

You can use a measure expression like this.  You can use a slicer for the date range, or wrap it in a CALCULATE with a filter on date.

 

LocationAverage =
AVERAGEX (
    DISTINCT ( Site[LocationName] ),
    CALCULATE ( AVERAGE ( 'HydroVu Data'[value] ) )
)

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

4 REPLIES 4
mahoneypat
Microsoft Employee
Microsoft Employee

You can use a measure expression like this.  You can use a slicer for the date range, or wrap it in a CALCULATE with a filter on date.

 

LocationAverage =
AVERAGEX (
    DISTINCT ( Site[LocationName] ),
    CALCULATE ( AVERAGE ( 'HydroVu Data'[value] ) )
)

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Ah, Distinct was the key, perfect! Thank you!

mh2587
Super User
Super User

can you put some dummy data here for more details


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



rssvlk
Frequent Visitor

Some data 

 

So averaging every row is 992.22, but what I want is an average of the averages for SensorName, which is 992.87.

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!

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.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.