Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
3 years ago
Solved

COUNT

Good morning I have the following table 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 genera...
  • djurecic's avatar
    3 years ago

    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!