cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AU555 Frequent Visitor
Frequent Visitor

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

Accepted Solutions
Community Support Team
Community Support Team

Re: calculation within the same column

@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
Community Support Team
Community Support Team

Re: calculation within the same column

@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

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 296 members 2,841 guests
Please welcome our newest community members: