Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

DAX command with multiple conditions for new column

Hi,

 

I am trying to create a column with the requirement. I want to filter out the rows where Date1<Date 2 only when Date1 has Data

If Date1 is blank  and if Date1>Date2 then "True" else "False".

 

Getting error "DAX comparison operations do not support comparing values of type Date with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values".

 

I have tried the same logic with whole number instead of True and false still getting the same error.

 

 

 

3 REPLIES 3
v-chenwuz-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please check whether the type of date1 or date2 is the same. 

vchenwuzmsft_1-1656473133511.png

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , Try

In power query

if Date1 = null and Date1>Date2 then 1 else 0

 

in DAX

if(isblank([Date1]) && Date1>Date2 , true(), false())

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thank you for the response, I have applied 

Column 2 =

IF(

    'Lead'[Date1]="",

    "",

    IF(

        'Lead'[Date1] < 'Lead'[Date2],

        "0",

        "1"

    )

)

Getting Error "DAX comparison operations do not support comparing values of type Date with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values".

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.