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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Cymbolz
Helper III
Helper III

COUNT function includes cells with text

Hello,

 

I am puzzled by the behavior of the DAX function COUNT.

 

Am expecting it to behave like Excel's count() function, in that it returns the count of cells with numbers but not text. 

 

The Reference Documentation indicates this too, "The COUNT function counts the number of cells in a column that contain numbers."

 

I see further info stating "If the row contains text that cannot be translated into a number, the row is not counted."

 

I've tested in Excel using both Power Pivot and DAX Studio, and in PBI Desktop.  In all cases, a column of type text with only text values (that couldn't possible be translated to a number) is returning a count equal to the number of rows / cells.  I expect zero as a result.  Am I missing something obvious, or has the behaviour changed / always been like this just not properly documented?

 

Eg measure:  Count Name:=COUNT('Table'[name])

1 ACCEPTED SOLUTION

Hi @Cymbolz,

 

I have reported this issue to the Product Team to investigate more. I will update here later.

 

Best Regards,

Dale

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

View solution in original post

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

I can confirm your results. I also believe that the behavior has changed as it used to not count text and you had to use COUNTA as I recall.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks @Greg_Deckler, glad it wasn't just me seeing this.

 

Would appreciate if a few others can confirm the same.

 

Thus, it would seem MS have changed the behaviour but not any documentation.  Wonder how many people wrote code relying on the previous functionality???  And maybe not even realise it's changed.

Hi @Cymbolz,

 

I have reported this issue to the Product Team to investigate more. I will update here later.

 

Best Regards,

Dale

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

Hi, 

 

The report ID is: 61341249.

 

Best Regards,

Dale

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

Hi @Cymbolz,

 

The document will be updated.

 

Best Regards,

Dale

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

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