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

View all the Fabric Data Days sessions on demand. View schedule

Reply
zahidah_mabd
Helper I
Helper I

Count Rows With non-numerical value

Hi, I want to count the number of values that is non numerical for the position code.

The position code should be numerical values only
i.e: 000113 , 1000034, 222564

I want to count the rows that contains alphabets in the position code
i.e: A100034 , B000386

Sample data:

Position Code
02060123
10007788
A2226934
G1000045
0345892B


The value type for Position Code is text because we want to include "0" in codes that starts with zero (i.e: 02060123). If I use integer/numeric type then power bi will automatically removes the "0" (i.e: 2060123)



How can I count the position codes with non-numeric value?

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @zahidah_mabd ,

 

You could create a measure as below:-

Measure =
CALCULATE (
    COUNT ( 'Table (2)'[Position Code] ),
    FILTER ( 'Table (2)', ISERROR ( INT ( 'Table (2)'[Position Code] ) ) )
)

 

BR,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

5 REPLIES 5
v-yalanwu-msft
Community Support
Community Support

Hi, @zahidah_mabd ;

You could add a column in power query , which could extract the alphabets from every rows:

=Text.Select([Position Code],{"A".."a"})

vyalanwumsft_1-1654220221284.png

 

and count of this column. filter the not blank rows:

vyalanwumsft_2-1654220336345.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Samarth_18
Community Champion
Community Champion

Hi @zahidah_mabd ,

 

You could create a measure as below:-

Measure =
CALCULATE (
    COUNT ( 'Table (2)'[Position Code] ),
    FILTER ( 'Table (2)', ISERROR ( INT ( 'Table (2)'[Position Code] ) ) )
)

 

BR,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

danextian
Super User
Super User

Hi @zahidah_mabd 

 

Create a column that will identify whether a row in a column is non-numeric

IsNonNumeric =
ISERROR ( VALUE ( 'Table'[Column] ) )

Use that column to count the rows that are non-numeric

NonNumeric = 
CALCULATE ( COUNTROWS ( 'Table'), filter('Table', 'Table'[IsNonNumeric] = TRUE() ))

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
tamerj1
Super User
Super User

Hi @zahidah_mabd 

yes this is doable 

would you please paste sample data to work with. Thank you

Position Code
02060123
10007788
A2226934
G1000045
0345892B

 


The value type for Position Code is text because we want to include "0" in codes that starts with zero (i.e: 02060123). If I use integer/numeric type then power bi will automatically removes the "0" (i.e: 2060123)

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors