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

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

Reply
user35131
Helper III
Helper III

Get average of grouped second column based on values within first column

I would like to get the average of counts of values within a column broken up by group defined by a second column

SportMethod
Basketball Ball
BasketballBall
BaseballBall
Baseball Ball
SoccerBall
MMA 

Gloves

Boxing Gloves
BoxingGloves
Boxing Gloves
WrestlingGrapling
JudoGrapling

 

Based on the long dataset that is the source I would like to create an outcome or measure where the values I get are 

 

MethodAverage
Grapling1
Gloves2
Ball1.667

 

Ball is 1.667 because Basketball has 2 rows, Baseball has 2 rows, and soccer has 1 row. (2+2+1)/3=1.667

 

Is a measure or table like this possible?

2 ACCEPTED SOLUTIONS
Jos_Woolley
Solution Sage
Solution Sage

Hi,

Average =
VAR MyTable =
    SUMMARIZE (
        'Table',
        'Table'[Sport],
        'Table'[Method],
        "Count", COUNTROWS ( 'Table' )
    )
RETURN
    AVERAGEX ( MyTable, [Count] )

Regards

View solution in original post

Fowmy
Super User
Super User

@user35131 

Create a measure as follows and add to a table visual with Method

Average Sport = 
DIVIDE(
    COUNTA(Table5[Sport]),
    DISTINCTCOUNT(Table5[Sport])
)

Fowmy_0-1630523259608.png

 


 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
Fowmy
Super User
Super User

@user35131 

Create a measure as follows and add to a table visual with Method

Average Sport = 
DIVIDE(
    COUNTA(Table5[Sport]),
    DISTINCTCOUNT(Table5[Sport])
)

Fowmy_0-1630523259608.png

 


 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Jos_Woolley
Solution Sage
Solution Sage

Hi,

Average =
VAR MyTable =
    SUMMARIZE (
        'Table',
        'Table'[Sport],
        'Table'[Method],
        "Count", COUNTROWS ( 'Table' )
    )
RETURN
    AVERAGEX ( MyTable, [Count] )

Regards

Thank You. I was wondering and i should have noted. Is there a way to freeze or lock the result of the average? Similar to the setup of this question. https://community.powerbi.com/t5/Desktop/Filter-by-slicer-for-one-column-but-freeze-or-lock-the-max-...

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.