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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Kelz0484
New Member

Returning todays date if other conditions are not met

Hi,

I have a dashboard with 2 date columns. 

Column A is a end date and column B is an extension date. I need a latest date column added with the following conditions:

If End date is > extension date then use end date,

If extension date is >= end date then use extension date else use todays date.

Note: Todays date would be used if both columns A&B were empty. 

I currently have the below If statement:

Latest Date = if[Extension Date]>=[End Date],[Extension Date],if[End Date]>[Extension Date],[End Date],today()))

But it isn't giving me today's date in the outcome its leaving blank cells.

 

Hope this makes sense

Any help appreciated

Thanks!

 

 

1 ACCEPTED SOLUTION
Martin_D
Super User
Super User

Hi @Kelz0484 ,
if[Extension Date]>=[End Date] is ture in case both columns are blank, then your formula returns [Extension Date] which is blank.
This formula should do the job:

 

COALESCE ( MAXX ( { 'Table'[End Date], 'Table'[Extension Date] }, [Value] ), TODAY() )

 

 

github.pnglinkedin.png

View solution in original post

2 REPLIES 2
Martin_D
Super User
Super User

Hi @Kelz0484 ,
if[Extension Date]>=[End Date] is ture in case both columns are blank, then your formula returns [Extension Date] which is blank.
This formula should do the job:

 

COALESCE ( MAXX ( { 'Table'[End Date], 'Table'[Extension Date] }, [Value] ), TODAY() )

 

 

github.pnglinkedin.png

Brilliant. Works a treat! Thank you so much.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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