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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
KRISH80
Helper II
Helper 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-old-Forecast-Value'.

 

Max date column is derived from the edited date column to identify the latest date and time an opportunity was edited. Now that i have the max date, i need to find out what is the associated latest 'old value'

Powerbi-SameVaue.png

 

2 ACCEPTED SOLUTIONS

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

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

HI @KRISH80 ,

 

If this solution works for you, please mark it as a solution.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

6 REPLIES 6
KRISH80
Helper II
Helper II

I tried using the DAX : 

Max Old Value =
VAR CurrentOppID = 'Krishna_Opp_Histrory_Forecast Category'[Max Date]
RETURN
MAXX(FILTER(ALL('Krishna_Opp_Histrory_Forecast Category'), 'Krishna_Opp_Histrory_Forecast Category'[Max Date] = CurrentOppID),'Krishna_Opp_Histrory_Forecast Category'[Old Value])
 
But it is not giving me the desired result. Pls see below :  The actual Max Old Value is'Best Case' but it is giving me 'Pipeline'.
All the below rows are from the Same Opportnity which got edited in different intervals.POwerbi-2.png

 

Hi @KRISH80 ,

 

Try modifying your DAX as follows:

Max Old Value = MAXX(
                                      FILTER(ALL('Krishna_Opp_Histrory_Forecast Category'), '
                     Krishna_Opp_Histrory_Forecast Category'[Max Date] = EARLIER('Krishna_Opp_Histrory_Forecast Category'[Max Date])),
                    ' Krishna_Opp_Histrory_Forecast Category'[Old Value]
                                     )
 
If this doesn't work please attache some sample data to try on or .pbix file.
 
If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂
 
Thanks,
Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Thanks a lot Pragati.. butit is not helping with opportunities which have multiple entries. Can you help me with your email id pls ? such that i can share some  sample file with you ?

HI @KRISH80 ,

 

You can upload a sample file here or you can send a private message.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super 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

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

HI @KRISH80 ,

 

If this solution works for you, please mark it as a solution.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.