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
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
Employee
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
Employee
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
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.