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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

DAX Formula Issue-Does not Support comparing value of Date type with Text type

Hey guys, 

 

I am trying to create the DAX fromula below:

If(Begin-Date)>"7/01/2019", "Yes", "No")

But it gives me the following error: Does not support comparing the value type of Date with value type of Text. 

How can I avoide that issue?

 

Thanks, 

Sona

3 ACCEPTED SOLUTIONS
FarhanAhmed
Community Champion
Community Champion

If( (Begin-Date) >Date(2019,07,01), "Yes", "No")







Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




View solution in original post

amitchandak
Super User
Super User

@Anonymous , as a new column

If([Begin-Date]> date(2019,01,7), "Yes", "No")

 

New measure

If(max(Table[Begin-Date])> date(2019,01,7), "Yes", "No")

 

In the case of the measure take care of row context. refer : https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Difference-Across/ba-p/934397#M451

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

View solution in original post

v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You cannot compare the different value types. You could use FORMAT(Begin-Date,"mm/dd/yyyy") to get text values or use DATE(2019,07,01) to get date values.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

3 REPLIES 3
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You cannot compare the different value types. You could use FORMAT(Begin-Date,"mm/dd/yyyy") to get text values or use DATE(2019,07,01) to get date values.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
amitchandak
Super User
Super User

@Anonymous , as a new column

If([Begin-Date]> date(2019,01,7), "Yes", "No")

 

New measure

If(max(Table[Begin-Date])> date(2019,01,7), "Yes", "No")

 

In the case of the measure take care of row context. refer : https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Difference-Across/ba-p/934397#M451

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
FarhanAhmed
Community Champion
Community Champion

If( (Begin-Date) >Date(2019,07,01), "Yes", "No")







Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors