The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Good moring,
I have a simple Dax code to check if a Date column is blank.
The code ISBLANK(_shipD) return true eventhough data existed. Function LEN and direct return _shipD has correct value
Will ISBLANK function applicable to Date column?
But regarding the row context, if the row has Date value, ISBLANK() should return false, isn't it?
es, the ISBLANK function is applicable to a Date column in DAX. However, it's important to understand how the function works and what might be causing it to return TRUE even when data exists.
The ISBLANK function returns TRUE when a given expression or column is truly blank or contains a null value. In the context of a Date column, a Date column can contain null values, which represent missing or undefined dates.
If ISBLANK(_shipD) is returning TRUE even when data exists in the _shipD column, it could mean that there are null values in the Date column. Null values in a Date column can occur if the data source contains missing or undefined dates.
To troubleshoot this issue, you can try the following:
Check Data Source: Examine the source data to ensure that there are no missing or undefined date values. Verify that all dates are correctly populated.
Null Handling: If you find null values in your Date column, you can handle them using DAX functions like IF(ISBLANK(_shipD), <default_value>, _shipD) to return a default value when the date is null.
Data Type: Ensure that the data type of the Date column is set to Date or DateTime, and that there are no unexpected data type conversions happening elsewhere in your DAX calculations.
Data Preview: Review the data preview in Power BI or your data source to verify that there are no unexpected null or blank entries in the Date column.
Data Cleansing: If necessary, clean and transform your data source to ensure that all date values are correctly formatted and populated.
Column Name: Ensure that there are no other columns in your data model with similar names that might be causing confusion.
By addressing these points, you should be able to identify and resolve the issue with the ISBLANK function returning TRUE for your Date column when data exists.
User | Count |
---|---|
20 | |
8 | |
7 | |
7 | |
6 |
User | Count |
---|---|
28 | |
12 | |
11 | |
9 | |
8 |