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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AU555
Helper I
Helper I

calculation within the same column

Hello everybody,

hope i can get help here with the formula for this i suppose easy calculation, but i just dont know how to solve this issue. 

I have this sample table and what I need to do is to calculate the difference between actual_finish field for each code when the same amount is installed. So when taking the first four rows I need to calculate 23/02/2019 - 13/02/2019 because both have the same installed amount and the code are not the same. So continuing, I need to calculate 24/02/2019 - 16/02/2019 because both have 2 amount installed and the code is kl1 at one date and kl2 at the second date.

2019-10-17 22_47_19-Book1 - Excel.pnggl.png

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@AU555 ,

 

You can create a calculate column using dax below:

Diff = 
VAR Earliest_Date = CALCULATE(MIN('Table'[Actual_Finish]), ALLEXCEPT('Table', 'Table'[amount installed]))
VAR Latest_Date = CALCULATE(MAX('Table'[Actual_Finish]), ALLEXCEPT('Table', 'Table'[amount installed]))
RETURN
DATEDIFF(Earliest_Date, Latest_Date, DAY)

Capture.PNG 

 

Community Support Team _ Jimmy Tao

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

1 REPLY 1
v-yuta-msft
Community Support
Community Support

@AU555 ,

 

You can create a calculate column using dax below:

Diff = 
VAR Earliest_Date = CALCULATE(MIN('Table'[Actual_Finish]), ALLEXCEPT('Table', 'Table'[amount installed]))
VAR Latest_Date = CALCULATE(MAX('Table'[Actual_Finish]), ALLEXCEPT('Table', 'Table'[amount installed]))
RETURN
DATEDIFF(Earliest_Date, Latest_Date, DAY)

Capture.PNG 

 

Community Support Team _ Jimmy Tao

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Kudoed Authors