Forum Discussion

Soumeli's avatar
Soumeli
Regular Visitor
8 months ago
Solved

How to manage date field with null values

Hi Team,   I am very new in Power BI. I need to create a calculated column where I am comparing two date fields eg. date1<= date2. date1 has null values and it is passing the condition. What is the...
  • danextian's avatar
    8 months ago

    This is one of those gotcha moments. DAX still evaluates the comparison to resolve the return type, and you end up seeing FALSE instead of BLANK(). A more fool proof way to do the comparison is by creating a custom column in the query editor.

    if [Date1] = null then null else [Date1] < [Date2]

     

    Vs has this formula and we should expect for it to return blank if Custom is blank but alas it won't once the data type is changed to true/false