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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
cottrera
Post Prodigy
Post Prodigy

DAX IF statement

Hi

I am using direct query and have  Repairs table with references and dates. I would like to add a new column with an IF statement that says IF Table = 07/10/2020 (UK date) , "Yes", No"

 

Repairs Table
Job RefDateNew Column
101/10/2020No
202/10/2020No
312/10/2020Yes
410/10/2020Yes
510/10/2020Yes
601/10/2020No
702/10/2020No
807/10/2020Yes
908/10/2020Yes
1005/10/2020No
1106/10/2020No
1212/10/2020Yes
1313/10/2020Yes
1404/10/2020No
1515/10/2020Yes

 

thanks

Richard

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@cottrera ,

Id Datatype of date is date

then try a new column

IF([DAte] =date(2020,10,7), "Yes", "No")

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

2 REPLIES 2
amitchandak
Super User
Super User

@cottrera ,

Id Datatype of date is date

then try a new column

IF([DAte] =date(2020,10,7), "Yes", "No")

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

Hi 

 

thank you for your response

 I tried IF([Date] =date(2020,10,7), "Yes", "No") and received a sytax error

 

How ever when I just added IF([Date] =date(2020,10,7) it gave me a true or false which is acceptable.

I will log this as resolved as between us it was.

 

thank you RIchard

 
 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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