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
parzival1220
Frequent Visitor

New Column with Power Query

Hi there,

 

Apologies I'm a bit new to Power Query 😑. I'm trying to create a new column that will return a Y or an N depending on whether a date is greater than another date. Both date columns I want to use are in date/time format, but the second date does contain some 'null' values (see below). 

 

parzival1220_0-1686559772545.png

I need to account for these by stating 'not closed' or similar. I've had a go with a couple of scripts to get the datediff working but both give me syntax errors (see screenshot below):

 

1. SLA Breach = if ('EasyVista Incidents'[End Date] > 'EasyVista Incidents[SLA Target] , "true","false")

2. Table.AddColumn(#"EasyVista Incidents", "Custom", each if, [End Date] > [SLA Target] then true else false)

 

parzival1220_0-1686570685090.png

I'm just not quite sure what I;ve done wrong. Any help would be greatly appreciated, TIA 😀

1 ACCEPTED SOLUTION
Shubham_Tekade
Frequent Visitor

Hello @parzival1220 ,

Refer to below blog - https://goodly.co.in/if-function-power-query/

it will help you to fix your problem.

Thanks,

Shubham

 

View solution in original post

2 REPLIES 2
parzival1220
Frequent Visitor

Thanks very much @Shubham_Tekade. Solves the problem perfectly. 😀

Shubham_Tekade
Frequent Visitor

Hello @parzival1220 ,

Refer to below blog - https://goodly.co.in/if-function-power-query/

it will help you to fix your problem.

Thanks,

Shubham

 

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.