Forum Discussion
Hoping
3 years agoHelper III
Check for a Column with all null values
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. ISBLANK does it for every row. But I want to check the en...
some_bih
3 years agoCommunity Champion
Hi Hoping in general to check if column contains null, one possible solution is
Is_Null_Column =
IF(
COUNTROWS(<YourTableName>) = COUNTBLANK(<YourTableName>[YourColumnName]),
"Yes:NULL",
"No:NOT NULL"
)
Did I answer your question? Mark my post as a solution! Kudos Appreciated!
- Alef_Ricardo_3 years agoResolver II
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"`.
Thank you for sharing your solution! 😊