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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
prear
Frequent Visitor

How to add a calculated column based on unique values in other row in Power query

I have a Table. I have three columns, ID, Date 1 and Date 2. Based on a unique ID, I want to create a New Column (Days) which gives the difference between Date 2 and Date 1 in days. Please can anyone help with this. Thank you.

IDDate 1Date 2New Column (Days)

1

10/10/2022null 
1nullnull 
1null13/10/2022            3
311/10/2022null 
3null12/10/2022            1
1 ACCEPTED SOLUTION
olgad
Super User
Super User

Hi, 
Group by min Date 1 and max Date 2

olgad_0-1677018277914.png

olgad_1-1677018310405.png

 


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

View solution in original post

2 REPLIES 2
prear
Frequent Visitor

Thank you for your help. It worked!

olgad
Super User
Super User

Hi, 
Group by min Date 1 and max Date 2

olgad_0-1677018277914.png

olgad_1-1677018310405.png

 


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.