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
MarshalSK
Resolver I
Resolver I

How to calculate Average value for each category

Hi Folks, How to achieve Average Sales for each category ? Note: if you have Filters it should affect the visual

 

MarshalSK_0-1704214699143.png

 

4 REPLIES 4
MarshalSK
Resolver I
Resolver I

@AlexisOlson  - Thanks for the prompt response. To give you a big pitcure. I am trying to create year wise average line , even if i apply Region filter average should be calculated after filtering the data.

 

MarshalSK_0-1704216521398.png

 

If you want a flat average line, then you'll need to remove the date filter context.

 

For example,

CALCULATE (
    AVERAGE ( Table1[Sales] ),
    ALLSELECTED ( Table1[Year], Table1[Quarter] )
)

 

There are two approaches:

1. Specify what filters you want to remove (and keep all others) using ALL or ALLSELECTED.

2. Specify what filters you want to keep (and remove all others) using ALLEXCEPT.

AlexisOlson
Super User
Super User

It depends on how exactly you want it to work in general (what columns to ignore and what not to), but I'd start with something like this:

CALCULATE (
    AVERAGE ( Table1[Sales] ),
    ALLSELECTED ( Table1[Sub Category] )
)

This tells it to remove the visual's filter context on Sub Category.

Hi @AlexisOlson , I need to calculate Average line per year, It should accomdate the filters. average line should be calculated on top of filtered data set. 

if you aware of super store data set , can you try from your end and let me know the solution.

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.

Top Solution Authors