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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
cghanta
Helper I
Helper I

Average Calculation

I have a table UPS and a column Age

 

The Power BI has a slicer based on column location

I want to find Average Age from the column Age, ignoring the slicer and display the measure in the report to dispaly the average as a card, irrespective of the slection in the slicer.

 

The following syntax is working:

CALCULATE(AVERAGE(UPS[Age for Avg]), ALL(UPS))
 
But, I want to exclude 0 entries in the Age column for the Average calculation, what syntax should I be using?
The following syntax is not working:
CALCULATE(AVERAGE(UPS[Age Avg]), ALL(UPS), FILTER(UPS, UPS[Age for Dual UPS Avg] <> 0))
3 ACCEPTED SOLUTIONS
mdaatifraza5556
Super User
Super User

Hi @cghanta 

Can you please try the below DAX.

CALCULATE(
AVERAGE(UPS[Age for Avg]),
ALL(UPS[Location]), 
UPS[Age for Avg] <> 0
)


Screenshot 2025-03-24 123841.png

 




If this answers your question, kindly mark it as the solution.

View solution in original post

xifeng_L
Super User
Super User

Hi @cghanta 

 

You also can try below measure:

 

CALCULATE(AVERAGE(UPS[Age Avg]),FILTER(ALL(UPS), UPS[Age for Dual UPS Avg] <> 0))

 

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

View solution in original post

Both the solutions from @xifeng_L and @mdaatifraza5556 worked, Thank you both.
I am not sure how to select both the replies as accepted solution

View solution in original post

6 REPLIES 6
cghanta
Helper I
Helper I

Both the solutions from @xifeng_L and @mdaatifraza5556 worked, Thank you both.
I am not sure how to select both the replies as accepted solution

xifeng_L
Super User
Super User

Hi @cghanta 

 

You also can try below measure:

 

CALCULATE(AVERAGE(UPS[Age Avg]),FILTER(ALL(UPS), UPS[Age for Dual UPS Avg] <> 0))

 

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

mdaatifraza5556
Super User
Super User

Hi @cghanta 

Can you please try the below DAX.

CALCULATE(
AVERAGE(UPS[Age for Avg]),
ALL(UPS[Location]), 
UPS[Age for Avg] <> 0
)


Screenshot 2025-03-24 123841.png

 




If this answers your question, kindly mark it as the solution.

Hi @mdaatifraza5556,

 

I have 2 columns on a the table UPS as follows

Location1stServiceAge2ndServiceAge
town130
town252
town360
town400
town521


How can I calculate (measure) the average age of both columns, ignoring 0's and slicer.  For the above the answer should be 19/6 = 3.17, if all zeros, give 0

Thank you in advance

Hi @mdaatifraza5556,

 

I have 2 columns on a the table UPS as follows

Location1stServiceAge2ndServiceAge
town130
town252
town360
town400
town521


How can I calculate (measure) the average age of both columns, ignoring 0's and slicer.  For the above the answer should be 19/6 = 3.17, if all zeros, give 0

Thank you in advance

Both the solutions from @xifeng_L and @mdaatifraza5556 worked, Thank you both.
I am not sure how to select both the replies as accepted solution

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.