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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Need help writting measure using grouped values

Hello, 

I'm trying to figure out the best way to resolve the following situation. 
I have this table:

PowerBoy_0-1631653490683.png


I need to sum the values of [Value] for each Month, and then with the results calculate the average: having as many elements as months grouped, in this example 3. 

PowerBoy_1-1631653820795.png

 

How would you implement this in DAX? The part of the measure that groups by months has to be filtered by the filter context, meaning that depending of it the number of months may change as well as the number of categories. 

Thanks in advance, 

Aleix

 





1 ACCEPTED SOLUTION
daxer-almighty
Solution Sage
Solution Sage

// Measure 1
[Total Value] = SUM( T[Value] )

// Measure 2
[Avg Monthly Value] =
AVERAGEX(
    DISTINCT( T[Month] ),
    [Total Value]
)

View solution in original post

2 REPLIES 2
daxer-almighty
Solution Sage
Solution Sage

// Measure 1
[Total Value] = SUM( T[Value] )

// Measure 2
[Avg Monthly Value] =
AVERAGEX(
    DISTINCT( T[Month] ),
    [Total Value]
)
Anonymous
Not applicable

Yes, I just realized this can be solved this way. Anyway, my doubt or question was trying to understand how to deal with aggregations affected by the filter context inside a formula. Since SUMMARIZED cannot be stored in a variable and has any of its columns referenced. Maybe that was my deep question ; ) Thanks for your answer.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.