Forum Discussion
KRISH80
6 years agoHelper II
LOOKUPVALE from the same table
Hi Team, I need hep to get the related value from the same table. I have a tabe below named Forecast Histroy and i need to find out the associated 'Old Value' for the 'Max Date' in the column 'Max-o...
- 6 years ago
Hi KRISH80 ,
This was tricky thing to resolve, but I have got a way to do it.
You MAX DATE date is fine.
For Maximum OLD Value, use the following DAX expression:
Max old value = CALCULATE(MAX('Sheet1 (2)'[Old Value]), FILTER('Sheet1 (2)', 'Sheet1 (2)'[Max Date] = EARLIER('Sheet1 (2)'[Max Date]) && 'Sheet1 (2)'[Opportunity ID] = EARLIER('Sheet1 (2)'[Opportunity ID]) && 'Sheet1 (2)'[Edit Date] = 'Sheet1 (2)'[Max Date test]))NOTE: Replace 'Sheet1 (2)' --> Your table nameI have tested this in Power BI using the sample data that you shared and it works perfectly fine!If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂Thanks,Pragati
Pragati11
6 years agoSuper User
Hi KRISH80 ,
This was tricky thing to resolve, but I have got a way to do it.
You MAX DATE date is fine.
For Maximum OLD Value, use the following DAX expression:
Max old value = CALCULATE(MAX('Sheet1 (2)'[Old Value]), FILTER('Sheet1 (2)', 'Sheet1 (2)'[Max Date] = EARLIER('Sheet1 (2)'[Max Date]) && 'Sheet1 (2)'[Opportunity ID] = EARLIER('Sheet1 (2)'[Opportunity ID]) && 'Sheet1 (2)'[Edit Date] = 'Sheet1 (2)'[Max Date test]))
NOTE: Replace 'Sheet1 (2)' --> Your table name
I have tested this in Power BI using the sample data that you shared and it works perfectly fine!
If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂
Thanks,
Pragati