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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.