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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
kboud3
Helper I
Helper I

Calculate difference of dates in rows

kboud3_0-1721680455044.png

I have a table that consists of many job numbers, activity name, and dates. Every job is listed twice because we are only looking at two activity names: Final Closing Walkthrough & Foundation - Concrete. I need to calculate the days from Base End Date (Concrete) to Base End Date (Closing). This is an example of one specific job

4 REPLIES 4
kboud3
Helper I
Helper I

I was able to get my solution goign a different route. I did 

Base DIP = DATEDIFF(CALCULATE(MAX('Concrete - Closing DIP'[BaseEndDate]),'Concrete - Closing DIP'[ActivityName]="Foundation - Concrete"),CALCULATE(MAX('Concrete - Closing DIP'[BaseEndDate]),'Concrete - Closing DIP'[ActivityName]="Final Closing Walkthrough"),DAY)

Hi, @kboud3 

Have you solved your problem? If so, can you share your solution here and mark the correct answer as a standard answer to help other members find it faster? Thank you very much for your kind cooperation!

 

Best Regards

Yongkang Hua

3CloudThomas
Super User
Super User

 you want to do in PowerQuery, look at Pivot and make Job 1-110-110 one row with ActivityName values used as a new column like (Final Closing Walkthru and Foundation - Concrete as column names as well as Base End Date and Act End Date. Then you can do a DateDiff between the date columns

Pivot job creates every job as a new column. Pivoting other columns makes the values 1 or 0. I might be misinterpreting your response

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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