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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Syndicate_Admin
Administrator
Administrator

Identify Most Recent Date Between Multiple Columns

I get my base from excel and my evaluation is made up of the columns:

ID | Ap1 Date | Ap2 Date | AP3 Date

I don't know anything about power query and I don't know if I need to know at this point since my question is the following, from the " Transform data" option, make the following evaluation:

1. Create and enter a new column that I'll call "Approval Date"

2. This column must have the following condition--> Bring Date 3, if date 3 is empty it returns date 2, if date 2 is empty it returns date 1

Note: I know I'll be given the option to work it from the "table view", but it is necessary to work on it from "transform data", for multiple reasons, the main one is that there are certain records that are duplicated and I have to group them, by doing this the Ap dates will disappear and I will only stay with "ID" and from this will emanate the "Approval Date".

Thank you very much for your support

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Syndicate_Admin ,

 

Here are the steps you can follow:

1. In power query – Add Column – Custom Column.

if [Ap3 Date] =null
then [Ap2 Date]
else if [Ap2 Date]= null
then [Ap1 Date] else null

vyangliumsft_0-1698129960247.png

vyangliumsft_1-1698129960249.png

2. Select [Ap1 Date], [Ap2 Date] and [Ap3 Date] – Remove Columns.

vyangliumsft_2-1698130011449.png

3. Result:

vyangliumsft_3-1698130011450.png

 

 

Best Regards,

Liu Yang

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi  @Syndicate_Admin ,

 

Here are the steps you can follow:

1. In power query – Add Column – Custom Column.

if [Ap3 Date] =null
then [Ap2 Date]
else if [Ap2 Date]= null
then [Ap1 Date] else null

vyangliumsft_0-1698129960247.png

vyangliumsft_1-1698129960249.png

2. Select [Ap1 Date], [Ap2 Date] and [Ap3 Date] – Remove Columns.

vyangliumsft_2-1698130011449.png

3. Result:

vyangliumsft_3-1698130011450.png

 

 

Best Regards,

Liu Yang

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

Ritaf1983
Super User
Super User

Hi @Syndicate_Admin 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

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.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.