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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.