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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
cottrera
Post Prodigy
Post Prodigy

Max date between two columns and dealing with null values

Hi Community 

I have just used the following M Code to try and output the max date of two columns

= List.Max({[Appointment Date]}&{[Appointment Date]})

I used the code provided in the link below.

Solved: How to get a MAX date between two columns in a pow... - Microsoft Power BI Community

 

However I need help in editing the code so that it deals with null values. As you can see in my example below. I would expect the 

#1 null to be 14/03/2023  a (circled below).  # 2 null seems to be working

cottrera_2-1683025232812.png

 

thank you

 

Richard

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

 

Perhaps new conditional column could fix it for you? if appointment date equals null then column maxjobnoteaddedwhen else appointment date.

 

If adding extra column is not an issue for you, this should help.

 

Kr,

A

 

View solution in original post

2 REPLIES 2
cottrera
Post Prodigy
Post Prodigy

Thank you for responsing so quickly😊

Anonymous
Not applicable

Hi,

 

Perhaps new conditional column could fix it for you? if appointment date equals null then column maxjobnoteaddedwhen else appointment date.

 

If adding extra column is not an issue for you, this should help.

 

Kr,

A

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.