<?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: Check for a Column with all null values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-for-a-Column-with-all-null-values/m-p/3380605#M127361</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/580655"&gt;@Hoping&lt;/a&gt;&amp;nbsp;in general to check if column contains null, one possible solution is&lt;/P&gt;&lt;P&gt;Is_Null_Column =&lt;BR /&gt;IF(&lt;BR /&gt;COUNTROWS(&amp;lt;YourTableName&amp;gt;) = COUNTBLANK(&amp;lt;YourTableName&amp;gt;[YourColumnName]),&lt;BR /&gt;"Yes:NULL",&lt;BR /&gt;"No:NOT NULL"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Did I answer your question? Mark my post as a solution! Kudos Appreciated!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Aug 2023 12:39:25 GMT</pubDate>
    <dc:creator>some_bih</dc:creator>
    <dc:date>2023-08-15T12:39:25Z</dc:date>
    <item>
      <title>Check for a Column with all null values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-for-a-Column-with-all-null-values/m-p/3350238#M125799</link>
      <description>&lt;P&gt;I wat to check if an entire column has null values and if yes, add another column with value "YES NULL" else "NO NOT NULL" repeating in DAX.&lt;BR /&gt;ISBLANK does it for every row. But I want to check the entire column.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The check for nulls needs to happen after the filters are applied.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR TABLE1 = 
CALCULATETABLE(
                             SUMMARIZE(  TAB[Col1],
                                         TAB[Col2],
                                         TAB[Col3]
                                       ),  
               KEEPFILTERS(FILTERTABLE)
               )

VAR NumberofRows = COUNTROWS(TABLE1)
VAR NumberofNullRows = COUNTBLANK(TABLE1[Col3])
VAR Check = IF(NumberofRows = NumberofNullRows, "YES ALL NULL", "NO NOT NULL")
VAR TABLE2 = ADDCOLUMNS(TABLE1, "Col4", Check)	
EVALUATE TABLE2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think above code is failing beause Variable Check in the above code is a single value. How can I make it into a list so that it can be added to the column?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 08:20:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-for-a-Column-with-all-null-values/m-p/3350238#M125799</guid>
      <dc:creator>Hoping</dc:creator>
      <dc:date>2023-07-26T08:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Check for a Column with all null values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-for-a-Column-with-all-null-values/m-p/3380605#M127361</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/580655"&gt;@Hoping&lt;/a&gt;&amp;nbsp;in general to check if column contains null, one possible solution is&lt;/P&gt;&lt;P&gt;Is_Null_Column =&lt;BR /&gt;IF(&lt;BR /&gt;COUNTROWS(&amp;lt;YourTableName&amp;gt;) = COUNTBLANK(&amp;lt;YourTableName&amp;gt;[YourColumnName]),&lt;BR /&gt;"Yes:NULL",&lt;BR /&gt;"No:NOT NULL"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Did I answer your question? Mark my post as a solution! Kudos Appreciated!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 12:39:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-for-a-Column-with-all-null-values/m-p/3380605#M127361</guid>
      <dc:creator>some_bih</dc:creator>
      <dc:date>2023-08-15T12:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Check for a Column with all null values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-for-a-Column-with-all-null-values/m-p/3381553#M127413</link>
      <description>&lt;P&gt;You are correct that the `Check` variable in your code is a single value, and you cannot add a single value to a column. Instead, you can use the `Check` variable as an input to the `ADDCOLUMNS` function to create a new column with the desired values. Here's an example of how you can modify your code to achieve this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;VAR TABLE1 = CALCULATETABLE( SUMMARIZE( TAB[Col1], TAB[Col2], TAB[Col3] ), KEEPFILTERS(FILTERTABLE) )&lt;BR /&gt;VAR NumberofRows = COUNTROWS(TABLE1)&lt;BR /&gt;VAR NumberofNullRows = COUNTBLANK(TABLE1[Col3])&lt;BR /&gt;VAR Check = IF(NumberofRows = NumberofNullRows, "YES ALL NULL", "NO NOT NULL")&lt;BR /&gt;VAR TABLE2 = ADDCOLUMNS(TABLE1, "Col4", Check)&lt;BR /&gt;EVALUATE TABLE2&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;In this modified version of your code, the `Check` variable is used as an input to the `ADDCOLUMNS` function, which creates a new column `Col4` in `TABLE2` with the value of `Check` for each row. This should give you the desired result of a new column with the value `"YES ALL NULL"` if all values in `Col3` are null, and `"NO NOT NULL"` otherwise.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps! Let me know if you have any further questions. &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2023 01:19:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-for-a-Column-with-all-null-values/m-p/3381553#M127413</guid>
      <dc:creator>Alef_Ricardo_</dc:creator>
      <dc:date>2023-08-16T01:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Check for a Column with all null values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-for-a-Column-with-all-null-values/m-p/3381554#M127414</link>
      <description>&lt;P&gt;Yes, that is one way to check if a column contains all null values. The `Is_Null_Column` measure you provided compares the number of rows in the table with the number of blank values in the specified column. If these two values are equal, it means that all values in the column are null, and the measure returns `"Yes:NULL"`. Otherwise, it returns `"No:NOT NULL"`.&lt;/P&gt;&lt;P&gt;Thank you for sharing your solution! &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2023 01:19:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-for-a-Column-with-all-null-values/m-p/3381554#M127414</guid>
      <dc:creator>Alef_Ricardo_</dc:creator>
      <dc:date>2023-08-16T01:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Check for a Column with all null values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-for-a-Column-with-all-null-values/m-p/3381938#M127431</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/580655"&gt;@Hoping&lt;/a&gt;&amp;nbsp;If this is solution, please accept it so other member of community could use it. Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2023 05:16:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-for-a-Column-with-all-null-values/m-p/3381938#M127431</guid>
      <dc:creator>some_bih</dc:creator>
      <dc:date>2023-08-16T05:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Check for a Column with all null values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-for-a-Column-with-all-null-values/m-p/3384045#M127499</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/555045"&gt;@some_bih&lt;/a&gt;&amp;nbsp; The check for NULL / BLANKS is after filtering.&amp;nbsp; How can keep the filters in the above code ?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2023 01:13:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-for-a-Column-with-all-null-values/m-p/3384045#M127499</guid>
      <dc:creator>Hoping</dc:creator>
      <dc:date>2023-08-17T01:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Check for a Column with all null values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-for-a-Column-with-all-null-values/m-p/3384408#M127509</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/580655"&gt;@Hoping&lt;/a&gt;&amp;nbsp;the solution is for column, all rows in single column to be checked if there are NULL&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2023 06:19:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-for-a-Column-with-all-null-values/m-p/3384408#M127509</guid>
      <dc:creator>some_bih</dc:creator>
      <dc:date>2023-08-17T06:19:11Z</dc:date>
    </item>
  </channel>
</rss>

