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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. 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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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