Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi All,
I have a column with text and numbers. I need to count of only numbers in that field.
I am trying to use FILTER but it's throwing error that it cannot support comparing values of type TEXT with values of type INTEGER.
Is there any way that i can do this?
Example:
Column1:
A
B
1
2
3
4
5
Here, I need to count only where column1=2
Thanks
KVB
Solved! Go to Solution.
My answer was for this Question:
have a column with text and numbers. I need to count of only numbers in that field.
Now, if you need to count only the rows with value 2.
Do this:
MyMeasure=Countrows(Filter(Table,Table[Column1]="2"))
Count all of the values that are numbers:
CountFunction = Calculate(
	count('Table'[Column1]),
	isNumber('Table'[Column1])
)
Count all of the values that equal 2:
CountFunction = Calculate(
	count('Table'[Column1]),
	'Table'[Column1] = 2
)
					
				
			
			
				
			
			
				
			
			
			
			
			
			
		I got blank values for the below formula
CountFunction = Calculate(
	count('Table'[Column1]),
	isNumber('Table'[Column1])
)
					
				
			
			
				
			
			
				
			
			
			
			
			
			
		@Anonymous
The measures only works if column1 are Number Type.
Ah rats. Good point.
hi, The first try with:
CountFunction =
CALCULATE (
    COUNT ( 'Table2'[Column1] ),
    NOT ( ISERROR ( VALUE ( 'Table2'[Column1] ) ) )
)
					
				
			
			
				
I got the same error.
My answer was for this Question:
have a column with text and numbers. I need to count of only numbers in that field.
Now, if you need to count only the rows with value 2.
Do this:
MyMeasure=Countrows(Filter(Table,Table[Column1]="2"))
Yes. It worked. Thank you.
These nice folks are trying to help, but I'm going with... "seriously?". Feels like you should redesign your table/model, cuz that is just WEIRD.
VARCHAR datatype and and internal conversions are common everywhere. Because of Power BI cannot process my data , I can't change my model.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.