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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Measure that sums up a column based on the average value grouped by category

Pretty straight forward. Any help is appreciated. Example below:

 

CategoryValue
a10
a10
b20
b20

 

Measure's results: 30

Because a + b = 10 + 20 = 30

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 

you can use

SUMX (

SUMMARIZE (

TableName, 

TableName[Category],

"@Average", AVERAGE ( TableName[Value] )

),

[@Average]
)

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

the associated output of the measure would be this:

 

Category2022.242022.252022.26
BCP-06001
BCP-08000

 

Counts if the category changes over time. The first screen shot from the previous reply is simply a count of the category.

tamerj1
Super User
Super User

Hi @Anonymous 

you can use

SUMX (

SUMMARIZE (

TableName, 

TableName[Category],

"@Average", AVERAGE ( TableName[Value] )

),

[@Average]
)

Anonymous
Not applicable

One more question: How would I convert this into a COUNTX?

 

This worked beautifully. Thanks so much by the way.

Hi @Anonymous 

what do you want to count exactly?

Anonymous
Not applicable

I want to count the averages grouped by category

@Anonymous 

The number of averages would be the number of categories. what is different is the distinct number of averages. In this case you may try

=
COUNTROWS (
    DISTINCT (
        SELECTCOLUMNS (
            SUMMARIZE (
                TableName,
                TableName[Category],
                "@Average", AVERAGE ( TableName[Value] )
            ),
            "@@Average", [@Average]
        )
    )
)
Anonymous
Not applicable

I would think that would work and I have come up with something similar. What I really need is the count of categories that change over a time period (see below). There would only be a count of 1 for the below snippet for 2022.26 column.

And then display them as a bar chart with x-axis being yyyy.ww

 

work22_0-1660852079472.png

 

sorry but still not able to pick up the idea. 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.