<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Count text values and return 0 if blank in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-text-values-and-return-0-if-blank/m-p/2481777#M67968</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="365527" data-lia-user-login="maneschr2022" class="lia-mention lia-mention-user"&gt;maneschr2022&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Count of Red colour =
IF (
    NOT ISBLANK ( COUNTROWS ( TABLE ) ),
    IF (
        ISBLANK ( COUNTROWS ( FILTER ( TABLE, TABLE[Colour] = "Red" ) ) ),
        0,
        COUNTROWS ( FILTER ( TABLE, TABLE[Colour] = "Red" ) )
    )
)&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 28 Apr 2022 01:57:55 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-04-28T01:57:55Z</dc:date>
    <item>
      <title>Count text values and return 0 if blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-text-values-and-return-0-if-blank/m-p/2476150#M67620</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I´m looking for a DAX that allows me to count the total number of a specific text value in a column, but if it is none/blank I want to show 0 instead of blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was trying to use this DAX formula:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Count of Red colour= COUNTROWS(FILTER(TABLE, TABLE[Colour]="Red")) +0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But for some reason when I add this measure as a value in a table it doesn´t load (my table already has a lot of values, not sure if that is related to that issue) when I remove the +0 it loads alright in the table, but I would like to show the 0 if there blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there another DAX that is better to do this? thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 23:38:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-text-values-and-return-0-if-blank/m-p/2476150#M67620</guid>
      <dc:creator>maneschr2022</dc:creator>
      <dc:date>2022-04-25T23:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Count text values and return 0 if blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-text-values-and-return-0-if-blank/m-p/2476178#M67623</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="365527" data-lia-user-login="maneschr2022" class="lia-mention lia-mention-user"&gt;maneschr2022&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;use&amp;nbsp;&lt;/P&gt;&lt;P&gt;Count of Red colour= IF ( ISBLANK (COUNTROWS(FILTER(TABLE, TABLE[Colour]="Red"))),&amp;nbsp;0,&amp;nbsp;&lt;SPAN&gt;COUNTROWS(FILTER(TABLE, TABLE[Colour]="Red")))&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 00:52:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-text-values-and-return-0-if-blank/m-p/2476178#M67623</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-04-26T00:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Count text values and return 0 if blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-text-values-and-return-0-if-blank/m-p/2476765#M67649</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="365527" data-lia-user-login="maneschr2022" class="lia-mention lia-mention-user"&gt;maneschr2022&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;this seems a very apt use case for the COALESCE() function. You can use it like :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count of Red colour NOBLANK =
COALESCE(COUNTROWS(FILTER(TABLE, TABLE[Colour]="Red")),0)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 06:49:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-text-values-and-return-0-if-blank/m-p/2476765#M67649</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-26T06:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Count text values and return 0 if blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-text-values-and-return-0-if-blank/m-p/2481757#M67966</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;and&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;both Dax work in terms of getting 0 instead of blank on my table visual, the only problem is that I get multiple rows instead of concentrated in one row, I`m using a column ID that generates the rows, but with this formula, I'm getting multiple times the same ID for 0, is there any DAX that can cover that issue as well all together?.&lt;/P&gt;&lt;P&gt;For the creation of my table, I'm using columns that belong to 2 different tables but they share in common the ID column.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 01:40:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-text-values-and-return-0-if-blank/m-p/2481757#M67966</guid>
      <dc:creator>maneschr2022</dc:creator>
      <dc:date>2022-04-28T01:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: Count text values and return 0 if blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-text-values-and-return-0-if-blank/m-p/2481777#M67968</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="365527" data-lia-user-login="maneschr2022" class="lia-mention lia-mention-user"&gt;maneschr2022&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Count of Red colour =
IF (
    NOT ISBLANK ( COUNTROWS ( TABLE ) ),
    IF (
        ISBLANK ( COUNTROWS ( FILTER ( TABLE, TABLE[Colour] = "Red" ) ) ),
        0,
        COUNTROWS ( FILTER ( TABLE, TABLE[Colour] = "Red" ) )
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 28 Apr 2022 01:57:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-text-values-and-return-0-if-blank/m-p/2481777#M67968</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-04-28T01:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: Count text values and return 0 if blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-text-values-and-return-0-if-blank/m-p/2481955#M67983</link>
      <description>&lt;P&gt;Thanks a lot! works perfect now!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 03:29:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-text-values-and-return-0-if-blank/m-p/2481955#M67983</guid>
      <dc:creator>maneschr2022</dc:creator>
      <dc:date>2022-04-28T03:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Count text values and return 0 if blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-text-values-and-return-0-if-blank/m-p/3349841#M125782</link>
      <description>&lt;P&gt;This approach of using Coalesce() is much cleaner and easier to maintain as calculation is not repeated.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 01:11:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-text-values-and-return-0-if-blank/m-p/3349841#M125782</guid>
      <dc:creator>zendu</dc:creator>
      <dc:date>2023-07-26T01:11:43Z</dc:date>
    </item>
  </channel>
</rss>

