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
AKA333
Regular Visitor

IF Statement Custom Column

I have two date columns new target delivery date and Original Delivery date

 

if New > original, then the column should read Late

 

if new <= original, then the column should read On Schedule.

 

dates readas mm/dd/yyyy

1 ACCEPTED SOLUTION

thank you that worked after I figured out I had to be in the Data tab not the report tab...

View solution in original post

6 REPLIES 6
AKA333
Regular Visitor

What would the IF statement look like?  I have tried several variations to no avail.

I'm not at all a DAX-expert, but this looks pretty straightforward, so I wonder what you tried?

 

Column = IF(Query1[New Target Delivery Date]>Query1[Original Target Delivey Date];"Late";"On Schedule")

Or are you looking for a Power Query solution?

 

Specializing in Power Query Formula Language (M)

semi-colons are not allowed.  So here is what I entered...

Column5 = IF(BuildTracker[New_TargetDeliveryDate]>BuildTracker[DeliveryDate],"Late","On Schedule")

 

But when I hit enter, I do not see a new column nor does that come back with an error?

Ah, I was on Dutch culture code with semicolons as delimiters.

 

After switching to en-US, your formula works fine with me (although I had to press ENTER twice):

 

IF Statement Custom Column.png

Specializing in Power Query Formula Language (M)

thank you that worked after I figured out I had to be in the Data tab not the report tab...

I have two date columns - New Target Delivery date and Original delivery date. 

 

if New is greater then Original, I want my column to read Late

 

if New is less than or equal to Original , I want my column to read On Schedule

 

what would the formula look like.  I have tried several ways and still no luck?

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.