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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
arpost
Post Prodigy
Post Prodigy

How to calculate a "grouped average" by category in a measure?

Greetings, DAX gurus. I know this is probably a fairly straightforward solution, but I can't for the life of me figure it out. Here's the scenario. I'm wanting to come up with the average for the total values for clients for each "period" of time a user is viewing (whole month, last 6 months, etc.). My data is similar to the following:

 

ClientMonthValue
AcmeTech8/1/2020100
AcmeTech8/1/202050
GenTech8/1/202050
TenTech9/1/202010
AcmeTech9/1/202020

 

Let's say a user is looking at 8/1/2020. I want a measure that calculates the avg. of AcmeTech's total for the month + GenTech's total for the month, which in standard math would be (150 + 50) / 2

 

If the period changes to, say, 6 months, I want it to update accordingly.

 

Any ideas?

1 REPLY 1
Jos_Woolley
Solution Sage
Solution Sage

Hi,

MyMeasure =
VAR MyTable =
    SUMMARIZE ( 'Table', 'Table'[Client], "Total Value", SUM ( 'Table'[Value] ) )
RETURN
    AVERAGEX ( MyTable, [Total Value] )

Regards

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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