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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
byWing
Helper I
Helper I

How to average without zero and by different category

Hi all,


I need help with this for a survey which I have conducted. 

 

I have this set of survey which I am trying to find the average hours/ people without zero:

PlacePeopleCategoryTaskSub-taskHours per month
WarehouseJohnOperationsPMPM Preperapation5
WarehouseJohnOperationsPMPM execution10
WarehouseJohnOperationsCMCM Preparation5
WarehouseJohnOperationsCMCM execution10
WarehouseJohnProjectProject supportProject Plan0
WarehouseJohnProjectProject supportSite Study0
WarehouseJohnProjectProject supportProject execution0
WarehouseMayOperationsPMPM Preperapation3
WarehouseMayOperationsPMPM execution2
WarehouseMayOperationsCMCM Preparation3
WarehouseMayOperationsCMCM execution5
WarehouseMayProjectProject supportProject Plan10
WarehouseMayProjectProject supportSite Study5
WarehouseMayProjectProject supportProject execution5
StoreTimOperationsPMPM Preperapation5
StoreTimOperationsPMPM execution6
StoreTimOperationsCMCM Preparation10
StoreTimOperationsCMCM execution5
StoreTimProjectProject supportProject Plan0
StoreTimProjectProject supportSite Study0
StoreTimProjectProject supportProject execution0
StoreJuneOperationsPMPM Preperapation5
StoreJuneOperationsPMPM execution9
StoreJuneOperationsCMCM Preparation4
StoreJuneOperationsCMCM execution6
StoreJuneProjectProject supportProject Plan10
StoreJuneProjectProject supportSite Study5
StoreJuneProjectProject supportProject execution9

 

 

byWing_0-1683541744863.png


I tried using this:

Avg hours without zeros = CALCULATE(AVERAGE('Table'[Hours Per Month]),FILTER('Table','Table'[Hours Per Month]<>0))
BUT it only works if I am breaking down my visual using sub-task, but not with the category.


What I hope to get:

1. Average hours per person in each place by category, with the tasks as legend.

2. Average hours per person in each place by task, with the sub-tasks as legend.

and 3. Average must exclude the people who input 0 for that category, task or sub-task (to remove the outliners)

 

I am getting myself all confused after reading all the posts. Any help will be much appreciated.

 

Thank you so much~

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @byWing 

 

You can try the following methods.

Measure = 
Var _table=FILTER('Table',[Hours per month]<>0)
Return
AVERAGEX(_table,[Hours per month])

vzhangti_0-1683685063943.png

vzhangti_2-1683685097696.png

Is this the result you expect? If not, please provide more sample output.

 

Best Regards,

Community Support Team _Charlotte

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

1 REPLY 1
v-zhangti
Community Support
Community Support

Hi, @byWing 

 

You can try the following methods.

Measure = 
Var _table=FILTER('Table',[Hours per month]<>0)
Return
AVERAGEX(_table,[Hours per month])

vzhangti_0-1683685063943.png

vzhangti_2-1683685097696.png

Is this the result you expect? If not, please provide more sample output.

 

Best Regards,

Community Support Team _Charlotte

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

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.