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
Anonymous
Not applicable

Calculate Average except one column

Hi all,

 

Below is a summary of what i have in my data. 

I need to calculate National Avg in the second Table below. My query currently looks like 

Avg National = CALCULATE(AVERAGE(Query1[Bill Rate]),ALL(Query1[State]))
 
But this is not giving me the expected result as you can see in the below image. Im expecting 55.96 for all the rows in the Table visual. But its not giving me that. Can anyone explain me how can i get it?

 

 

 

1 ACCEPTED SOLUTION

@Anonymous  Can you try this? It worked for me in one of the scenarios

 

Avg National = 
CALCULATE(AVERAGE(Query1[Bill Rate]),ALL(Query1[State]),ALLSELECTED(Query1[Division],Query1[Assignment Type],Query1[Speciality]))

 

 

View solution in original post

9 REPLIES 9
Sujit_Thakur
Solution Sage
Solution Sage

Dear friend I didn't understood the question well, But to the point which I understood you may try this Avg National = CALCULATE(AVERAGE(Query1[Bill Rate])) Please explain it once more so that I could help
Anonymous
Not applicable

@Sujit_Thakur 

 

Hi Sujit,

 

Im trying to get the National Avg.  Basically i dont want column State to play any role in the calculation. In the below image there are two table visuals. In the 2nd table, i have division, assignment type, speciality and state. I want the average to be calculated including division, assignment type, speciality but excluding state which should be the national avg.

 

 

 

@Anonymous  Can you try this? It worked for me in one of the scenarios

 

Avg National = 
CALCULATE(AVERAGE(Query1[Bill Rate]),ALL(Query1[State]),ALLSELECTED(Query1[Division],Query1[Assignment Type],Query1[Speciality]))

 

 

Anonymous
Not applicable

@amitjzaveri  Superb 

 

Thanks a lot.. 

Anonymous
Not applicable

Please can anyone help me with this please...

amitchandak
Super User
Super User

@Anonymous , Try like

 

Avg National = CALCULATE(AVERAGE(Query1[Bill Rate]),removefilters(Query1[State]))

 

or best is create a table of distinct State join with this table and try like
Avg National = CALCULATE(AVERAGE(Query1[Bill Rate]),ALL(State[State]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak 

 

Even Removefilters is not giving me the expected results. In below image, i expect 92.14 in all the 3 rows. Please please help me.

 

I cant have a different state table as the current state filter is already applied for other visuals.

 

 

 

@Anonymous , then the way is to use all and push the filter you need

 

example

Avg National = CALCULATE(AVERAGE(Query1[Bill Rate]),filter(ALL(Table), Table[Assignment_type] in values(Table[Assignment_type]) && Table[division] in values(Table[division]) ))
or
Avg National = CALCULATE(AVERAGE(Query1[Bill Rate]),filter(ALL(Table), Table[Assignment_type] in allselected(Table[Assignment_type]) && Table[division] in allselected(Table[division]) ))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak  Unfortunately, these DAX are also not giving me the expected result. Kindly review the below and let me know if im missing anything here. 

 

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.