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
AutoJL
Helper II
Helper II

Filtering out only numeric values for an AVERAGEX

Hi everyone,

 

I need to filter out only numeric values of a column in order to do a proper AVERAGEX but I am failing horribly to do so and i dont know why.

 

This is what my data looks like:

 

Data.PNG

 

Where "number of inputs" is a calculated column. The column "SampleID" is purposely left with Text type to allow me to capture the "No_BARCODE". 

Issue comes when trying to calculate the average of the column "number of inputs" since it is using all the posible values including the "NO_BARCODE" one which is of course wrong ( it is falsely elevating the average ).

 

I have tried a measure using the AVERAGEX function and then FILTER also but for some reason it is not working, it gives me a blank result.

 

Average number of inputs = AVERAGEX (FILTER(Samples,ISNUMBER(Samples[SampleID])=TRUE),Samples[Number of inputs])
 
Can I get some help on why this is not working and how to achieve it correctly?
 
Many thanks in advance,
Jose
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@AutoJL , If only NO_BARCODE is text then try like

 

Average number of inputs = AVERAGEX (FILTER(Samples,Samples[SampleID] <> "NO_BARCODE"),Samples[Number of inputs])

 

Otherwise explore in power query

Split Column By Digit to Non Digit & Non Digit to Digit: https://youtu.be/tY4Yk1crS9s

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

View solution in original post

2 REPLIES 2
AutoJL
Helper II
Helper II

Hi amitchandak

 

Many thanks for the answer! Indeed it is the only non numeric value and of course it worked, I knew there would be a simple solution just couldnt figure it out, I guess I need more practice!

 

I just marked your post as solution but after confirming that it indeed works I realized there is another issue. Since the table actually contains all the duplicates by running the formula on the whole table all values are being used instead of just once per SampleID instance. 

 

Any ideas on how to deal with that?

 

Many thanks again!

amitchandak
Super User
Super User

@AutoJL , If only NO_BARCODE is text then try like

 

Average number of inputs = AVERAGEX (FILTER(Samples,Samples[SampleID] <> "NO_BARCODE"),Samples[Number of inputs])

 

Otherwise explore in power query

Split Column By Digit to Non Digit & Non Digit to Digit: https://youtu.be/tY4Yk1crS9s

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

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.