Forum Discussion
waldnerr
4 years agoHelper I
Lookup latest value
Hi, i would like create a calculated column called "Program Name" in the "Global Project" for each GlobalProjectKey. The relevant value is stored in the table "Custom Fields", column "Program Na...
- 4 years ago
Hi waldnerr,
You can try this new column, it is a little long.
Program Name = var LastestDate = CALCULATE( MAX('Project Period'[Datekey]), FILTER('Project Period',[GlobalProjectKey]=EARLIER('Global Project'[Globalprojectkey])) ) var LastestKey = CALCULATE( MAX('Project Period'[ProjectPeriodKey]), FILTER('Project Period',[Globalprojectkey]=EARLIER('Global Project'[Globalprojectkey]) && [Datekey]=LastestDate) ) RETURN CALCULATE( MAX('Custom Fields'[Program Name]), FILTER('Custom Fields',[Globalprojectkey]=EARLIER('Global Project'[Globalprojectkey]) && [ProjectperiodKey]=LastestKey) )Here's the file I made with your data, you can try it.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-chenwuz-msft
4 years agoCommunity Support
Hi waldnerr,
You can try this new column, it is a little long.
Program Name =
var LastestDate =
CALCULATE(
MAX('Project Period'[Datekey]),
FILTER('Project Period',[GlobalProjectKey]=EARLIER('Global Project'[Globalprojectkey]))
)
var LastestKey =
CALCULATE(
MAX('Project Period'[ProjectPeriodKey]),
FILTER('Project Period',[Globalprojectkey]=EARLIER('Global Project'[Globalprojectkey]) && [Datekey]=LastestDate)
)
RETURN
CALCULATE(
MAX('Custom Fields'[Program Name]),
FILTER('Custom Fields',[Globalprojectkey]=EARLIER('Global Project'[Globalprojectkey]) && [ProjectperiodKey]=LastestKey)
)
Here's the file I made with your data, you can try it.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- waldnerr4 years agoHelper I
Thank you, your proposed solution works perfectly.
Thank you too for your valuable input.