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

Populating a Calculated Column with the greater value of two date columns found in the same table

I have a table that contains three columns: ID, Date01, Date02.

Ideally I want to create a third column (Date03) within the same table that stores the greater of these two date values. (Date01 or Date02)

Thus far I have not been able to generate the means to populate Date03 as a calculated column in my existing table.

If for technical reasons it is not possible for me to create a calculated column to store Date03 in the same table, I am open to somehow creating another table that would store the ID,Date03 (Date03 being the greater of Date01 or Date02) and then I could use the ID to relate Date03 back to the parent table.

Appreciate any assistance one might be able to offer to help me in this.

Thank you!

 

 

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Hello @carlhild 

 

Could you try the following

LastOverAllUpdate = IF( Table1[LastUpdateDateProj] > Table1[LastPLCUpdateDate], Table1[LastUpdateDateProj], Table1[LastPLCUpdateDate])

If I am understanding what you are looking for it works:

LastOverallUpdate.png

View solution in original post

4 REPLIES 4
jdbuchanan71
Super User
Super User

Hello @carlhild 

 

Could you try the following

LastOverAllUpdate = IF( Table1[LastUpdateDateProj] > Table1[LastPLCUpdateDate], Table1[LastUpdateDateProj], Table1[LastPLCUpdateDate])

If I am understanding what you are looking for it works:

LastOverallUpdate.png

Hi jdbuchanan71,

 

Works perfect!!

 

Thank you!! 

 

 

 

MFelix
Super User
Super User

Hi @carlhild ,

 

Reading your ext I was in doubt if you want the MAX value of all the values of DATE1 or DATE2 or the MAX value per row of the table in any case see below the syntax for both situations:

MAX BY ROW = MAXX(Table;Max(Table[Date01];Table[Date02]))

MAX DATE = MAX(Table[Date01];Table[Date02])

Regards,

MFelix

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi MFelix,

Thank you for your help!

I tried your solution offered, and it looked so promising, but the MAX() element of this wants to report the max date across the entire column and not within the row itself.

I put a screenshot of my table below showing the typed in formula,  hoping that a picture might speak more than me. (I appologize as I'm a bit new at this...in fact this is my first ever post to this community.

I'm seeking to compare within each row Date01 and Date02 and then report the higher of the two dates into a calculated column Date03. 

Thank you again so much for your assistance.

 

 

 

Weekly Monthly Unit Vol EstimatesWeekly Monthly Unit Vol Estimates

 

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.