Forum Discussion
Calculating Average while ignoring zero/null values
- 3 years ago
Hi,
Thank you for your feedback.
Could you please check the below measure and the attached file, whether it suits your requirement?
Average (February & March) = ( ( CALCULATE ( SUM ( [Working Hour] ), FILTER ( 'Sample', 'Sample'[Month] = "February" ) ) ) + ( CALCULATE ( SUM ( [Working Hour] ), FILTER ( 'Sample', 'Sample'[Month] = "March" ) ) ) ) / COUNTROWS ( FILTER ( 'Sample', 'Sample'[Month] IN { "February", "March" } && 'Sample'[Working Hour] <> 0 ) )
Hi,
Thank you for your feedback.
Could you please check the below measure and the attached file, whether it suits your requirement?
Average (February & March) =
(
(
CALCULATE (
SUM ( [Working Hour] ),
FILTER ( 'Sample', 'Sample'[Month] = "February" )
)
)
+ (
CALCULATE (
SUM ( [Working Hour] ),
FILTER ( 'Sample', 'Sample'[Month] = "March" )
)
)
)
/ COUNTROWS (
FILTER (
'Sample',
'Sample'[Month]
IN { "February", "March" }
&& 'Sample'[Working Hour] <> 0
)
)
Thanks so much Jihwan_Kim . It worked. I also need to find an average of conversion rate as follows. But the average is not accurate when it comes to the average conversion of of 'David' or 'Maya'. For David, it should be- 108.335 and for Maya-30.555
Below is the updated PBI file-
https://drive.google.com/file/d/1MPwUn89yxiUYwSWpJKispl7LesBJQd9Y/view?usp=share_link
The Dataset-
- Jihwan_Kim3 years agoSuper User
Hi,
Please check the attached file whether it suits your requirement.
Thanks.
- Green_Cloud3 years agoHelper I
It should ignore the 0% conversion rate for John and Alex. It is considering that.