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
NZCraig
Helper I
Helper I

If statements with multiple null conditions

Hi,

 

I am slowly learning Power Query M, but I've gone down a rabbit hole and neeed some help to correct my thinking please! I need to return a column that provides a single date from multiple date fields, based on a heirarchy.

 

The plain language version is:

If the [assignment.scheduledate] date field is not empty, return this date, unless the [schedstart] field has a date and this date is greater than the [assignment.scheduledate].

If the [assigment.schedule] date is not empty then return the [schedstart] date field. 

If the assignment.schedule date and the schedstart date fields are both empty, return the targstartdate field.

 

I've tried many variations of the below, but cannot seem to get an error in the results when there is an [assignment.scheduledate] . Any help would be very much appreciated!

 

if [assignment.scheduledate] <> null and ([assignment.scheduledate] >= [shedstart]) then [assignment.scheduledate] else
if [assignment.scheduledate] <> null and ([assignment.scheduledate] < [shedstart]) then [schedstart] else
if [assignment.scheduledate] is null and [schedstart] <> null then [schedstart] else
if [assignment.scheduledate] is null and [schedstart] is null then [targstartdate] else null)

 

1 REPLY 1
dax
Community Support
Community Support

Hi @NZCraig , 

What is your error information of above expression? I think you need to delete the ")" at the end of expression. In addition, if possible, could you please inform me more detailed information(such as your expected output and your sample data (by OneDrive for Business))? Then I will help you more correctly.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Top Solution Authors