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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Syndicate_Admin
Administrator
Administrator

COUNT

Good morning

I have the following table tabla01.jpg

On which I want to calculate the percentage of product lines that do not have a text, in the comment column, I understand that for this I must generate a measure that transforms into numerical value the cells that have or do not have value, I have tried through COUNTX, but reflects the real data.

You can help me, thanks in advance

1 ACCEPTED SOLUTION
djurecicK2
Super User
Super User

Hi @Syndicate_Admin ,

 You can try the following:

 

1) Create a measure to count all products in the table- please adjust for your table and field names

ProductCount= COUNT(TableName[Producto])

 

2) Create a measure to count non-blank comments

CommentCount= COUNT(TableName[Comentario])

 

3) Divide the 2 measures to get percent with comments

PercentWithComments= DIVIDE([CommentCount],[ProductCount],0)

 

The COUNT function ignores blank values:

https://learn.microsoft.com/en-us/dax/count-function-dax

 

Please mark as solution if this answers the question- thanks!

View solution in original post

1 REPLY 1
djurecicK2
Super User
Super User

Hi @Syndicate_Admin ,

 You can try the following:

 

1) Create a measure to count all products in the table- please adjust for your table and field names

ProductCount= COUNT(TableName[Producto])

 

2) Create a measure to count non-blank comments

CommentCount= COUNT(TableName[Comentario])

 

3) Divide the 2 measures to get percent with comments

PercentWithComments= DIVIDE([CommentCount],[ProductCount],0)

 

The COUNT function ignores blank values:

https://learn.microsoft.com/en-us/dax/count-function-dax

 

Please mark as solution if this answers the question- thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.