Forum Discussion
Problem with COUNT function
- 10 years ago
GilesWalker Your solution will work if the CodeID is a numeric value but it can be a text value and a68tbird wants to count text values in the column.
a68tbird Count function only works with numeric and date values in the column. See here
In case you want to count text values you need to use COUNTA() instead of COUNT()
a68tbird this sounds like an easy fix. The error message is telling you that one of the fields within the equation is formatted as text, however to do divides you need it to be a number.
On the right hand side of Power BI desktop you will see your tables and columns, click on CodeID. You will notice the ribbon at the top of the page will change and show the below image:
In the formatting section you can change the data type. Currently it probably says TEXT, change this to whole number, or decimal number (depends on your needs).
This will change the formatting allowing you to use the DIVIDE function.
If this doesnt work please let me know.
Thanks,
Giles
GilesWalker Your solution will work if the CodeID is a numeric value but it can be a text value and a68tbird wants to count text values in the column.
a68tbird Count function only works with numeric and date values in the column. See here
In case you want to count text values you need to use COUNTA() instead of COUNT()
- a68tbird10 years agoResolver II
Thanks very much! COUNTA was what I needed. Simple fix.
- GilesWalker10 years agoSkilled Sharer
HarrisMalik spot on, forgot to mention the COUNTA function, good call.