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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
calvgo
Helper I
Helper I

Grab value from another row to current row value

Guys- have a question here.

 

I am trying to grab an Actual FinishDate value from each project and then reflect it in a new column/measure. In this example, for project ID 1000, I like to get the actual FinishDate from Phase Name [milestone 1] and insert it into Phase Name [Phase 1]. 

Then I will do that for project ID 2000 etc. 

 

I will use the same logic for Phase 2, milestone 2 etc for subsequent projects.

 

calvgo_1-1639634795273.png

 

 

2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture.

It is for creating a new column.

 

Picture2.png

 

Actual_Milestone CC =
VAR currentproject = Data[Project ID]
VAR currentphasenumber =
RIGHT ( Data[Phase Name], 1 )
VAR filter_only_milestone =
FILTER (
Data,
Data[Project ID] = currentproject
&& CONTAINSSTRING ( Data[Phase Name], "M" )
&& RIGHT ( Data[Phase Name], 1 ) = currentphasenumber
)
VAR milestonedate =
MAXX ( filter_only_milestone, Data[Actual Finishdate] )
RETURN
IF ( Data[Estimate Finishdate] = BLANK (), BLANK (), milestonedate )


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

Anonymous
Not applicable

Hey! @calvgo 

 

The following Calculated Column works perfectly fine.

 

shwetadalal_0-1639642096594.png

NewCol =
VAR rightval =
RIGHT ( 'Table'[Phase Name], 1 )
VAR maxval =
CALCULATE (
MAX ( 'Table'[Actual Date] ),
FILTER (
ALL ( 'Table' ),
EARLIER ( 'Table'[ProjectID] ) = 'Table'[ProjectID]
&& RIGHT ( 'Table'[Phase Name], 1 ) = rightval
&& LEFT ( 'Table'[Phase Name], 1 ) = "M"
)
)
RETURN
IF ( 'Table'[Estimate Date] = BLANK (), BLANK (), maxval )
 
Please accept it as a solution if it fulfills your requirement.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hey! @calvgo 

 

The following Calculated Column works perfectly fine.

 

shwetadalal_0-1639642096594.png

NewCol =
VAR rightval =
RIGHT ( 'Table'[Phase Name], 1 )
VAR maxval =
CALCULATE (
MAX ( 'Table'[Actual Date] ),
FILTER (
ALL ( 'Table' ),
EARLIER ( 'Table'[ProjectID] ) = 'Table'[ProjectID]
&& RIGHT ( 'Table'[Phase Name], 1 ) = rightval
&& LEFT ( 'Table'[Phase Name], 1 ) = "M"
)
)
RETURN
IF ( 'Table'[Estimate Date] = BLANK (), BLANK (), maxval )
 
Please accept it as a solution if it fulfills your requirement.

Hi Shwet

 

what if data is changed to the following:

 

ProjectNamePhase NameForecastFinishDateActualFinishDateCalculated Value

1000Project Initiation Phase23/01/20185/02/20185/02/2018
1000M02XYZ00/00/00005/02/2018 
1000Scope and Feasibility Phase28/05/201812/07/201812/07/2018
1000M04AGD00/00/000012/07/2018 
1000Design Phase14/06/201911/06/201928/05/2019
1000M12ADS00/00/000028/05/2019 
1000Delivery Phase20/05/202027/08/202030/04/2020
1000M23AAA00/00/000030/04/2020 
1000Hand Over Phase10/12/20194/02/20214/02/2021
1000M24BBB00/00/00004/02/2021 
1000Project Close Phase10/12/201900/00/00004/02/2021
1000M25CCC00/00/00004/02/2021 
2000Delivery Phase29/01/201900/00/000000/00/0000
2000M23AAA00/00/000000/00/0000 
2000Hand Over Phase1/03/201900/00/000000/00/0000
2000M24BBB00/00/000000/00/0000 
2000Project Close Phase29/02/202000/00/000000/00/0000
2000M25CCC00/00/000000/00/0000 
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture.

It is for creating a new column.

 

Picture2.png

 

Actual_Milestone CC =
VAR currentproject = Data[Project ID]
VAR currentphasenumber =
RIGHT ( Data[Phase Name], 1 )
VAR filter_only_milestone =
FILTER (
Data,
Data[Project ID] = currentproject
&& CONTAINSSTRING ( Data[Phase Name], "M" )
&& RIGHT ( Data[Phase Name], 1 ) = currentphasenumber
)
VAR milestonedate =
MAXX ( filter_only_milestone, Data[Actual Finishdate] )
RETURN
IF ( Data[Estimate Finishdate] = BLANK (), BLANK (), milestonedate )


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi JH,

 

Thanks for your post. What if data is changed to the below?

 

ProjectNamePhase NameForecastFinishDateActualFinishDateCalculated Value

1000Project Initiation Phase23/01/20185/02/20185/02/2018
1000M02XYZ00/00/00005/02/2018 
1000Scope and Feasibility Phase28/05/201812/07/201812/07/2018
1000M04AGD00/00/000012/07/2018 
1000Design Phase14/06/201911/06/201928/05/2019
1000M12ADS00/00/000028/05/2019 
1000Delivery Phase20/05/202027/08/202030/04/2020
1000M23AAA00/00/000030/04/2020 
1000Hand Over Phase10/12/20194/02/20214/02/2021
1000M24BBB00/00/00004/02/2021 
1000Project Close Phase10/12/201900/00/00004/02/2021
1000M25CCC00/00/00004/02/2021 
2000Delivery Phase29/01/201900/00/000000/00/0000
2000M23AAA00/00/000000/00/0000 
2000Hand Over Phase1/03/201900/00/000000/00/0000
2000M24BBB00/00/000000/00/0000 
2000Project Close Phase29/02/202000/00/000000/00/0000
2000M25CCC00/00/000000/00/0000 
Samarth_18
Community Champion
Community Champion

Hi @calvgo ,

 

Please provide some sample data in a text format and expected output.

You can follow the below post to get your answer quickly:-

 

https://community.powerbi.com/t5/DAX-Commands-and-Tips/How-to-Get-Your-Question-Answered-Quickly/m-p...

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
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.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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