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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Average by Category

Hi, 

 

I am trying to calculate the average by categroy however, my numbers are not adding up. 

HELP_PLS_0-1662977254357.png

 

AVERAGE = HELP_PLS_1-1662977483290.png

 

 

 

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

Try formula like below:

M_ =
VAR count_category =
    COUNTROWS ( ALLEXCEPT ( 'Table', 'Table'[Category] ) )
VAR sum_ =
    CALCULATE ( SUM ( 'Table'[Value] ), ALL ( 'Table' ) )
RETURN
    DIVIDE ( sum_, count_category, BLANK () )

vhenrykmstf_0-1663038492389.png

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

Try formula like below:

M_ =
VAR count_category =
    COUNTROWS ( ALLEXCEPT ( 'Table', 'Table'[Category] ) )
VAR sum_ =
    CALCULATE ( SUM ( 'Table'[Value] ), ALL ( 'Table' ) )
RETURN
    DIVIDE ( sum_, count_category, BLANK () )

vhenrykmstf_0-1663038492389.png

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Yossarian
Helper I
Helper I

Hey,

 

Why not just use the average function?
Put it in a table visual with category and the measure - average(Table[category])

keshavagrawal27
Resolver I
Resolver I

Hello @Anonymous ,

You can use group by to fulfil your requirement.

Please mark it as a solution if was helpful.

Regards,

Keshav Agrawal

Anonymous
Not applicable

Hi, 

I would just like to average for one chart and not change all my data. When I used the group by in "Transfrom" it changed all my data

Try with Dax

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.

Top Kudoed Authors