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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
NISHA_S
Resolver I
Resolver I

exclude o values while calculating average

testimage.PNG

I have this set of dataset.I want to calculate average of brokerage_perecntage_of_gross_premium where end_cert=0 .Also   exclude brokerage_perecntage_of_gross_premium <> 0.

I just calculate avg using measure...but excluding zero is not done..

Here is my measure 

CALCULATE( DIVIDE(SUM('data'[brokerage_percentage_of_gross_premium]),COUNT('data'[fact_id]),0),'data'[endt_cert]=0 )
 
How can i exclude o values here.....Please help?
1 ACCEPTED SOLUTION
webportal
Impactful Individual
Impactful Individual

Ok, then try this one:

 

Measure =
CALCULATE (

AVERAGE('data'[brokerage...]),
FILTER('data, 'data'[brokerage_percentage_of_gross_premium <>0 && 'data'[endt_cert] = 0))

View solution in original post

4 REPLIES 4
v-robertq-msft
Community Support
Community Support

Hi, @NISHA_S 

According to your description and sample data, I think you can achieve this using the Averagex() function, you can try this measure:

Average =

AVERAGEX(FILTER(ALLSELECTED('Table'),[brokerage_percentage_of_gross_premium]<>0&&[endt_cert]=0),[brokerage_percentage_of_gross_premium])

Then place the measure into a card chart, and you can get what you want.

v-robertq-msft_0-1619146520100.png

 

You can download my test pbix file below

More info about the Averagex() function in DAX

 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

webportal
Impactful Individual
Impactful Individual

Ok, then try this one:

 

Measure =
CALCULATE (

AVERAGE('data'[brokerage...]),
FILTER('data, 'data'[brokerage_percentage_of_gross_premium <>0 && 'data'[endt_cert] = 0))

webportal
Impactful Individual
Impactful Individual

Try this measure:

 

Measure =
CALCULATE (AVERAGE('data'[brokerage...]), 'data'[endt_cert] = 0)

 

For the calculation where endt_cert is not equal to zero just replace =0 by <> 0

i don't want to exclude endt_cert <>0 , i need to exclude only brokerage_percentage_of_gross_premium <>0  and include only endt_cert=0

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.