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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
qbarnes
Helper I
Helper I

Find "last" text value within another table, based on Most Recent Date

Hello Everyone, 

 

I'm in need of assistance, as I have two tables that I'm working with...   My Entire_Portfolio_Table has all loans in our portfolio, and my Modification_Table only contains loans that have ever been modified. 

 

The Modification Table, does consist of multiple Modification Types, for various reasons, throughout the lifecycle of each loan.   I need to pull in the most recent ModType by Date (from the Modification_Table), into my Entire_Portfolio_Table.

 

Modification_Table

LeadidModTypeModDate
0002PmtHoliday2/1/2020
0002SubsequentMod3/15/2020
0002PermanentMod5/14/2020
0003CovidMOD4/1/2020
0005PmtHoliday1/20/2020
0005CovidMOd4/1/2020
0005PermanentMod6/1/2020

 

 

Entire_Portfolio_Table:

LeadidDateFundedModTypeModDate

0001

1/2/2017nullnull
00021/2/2017PermanentMod5/14/2020
00032/12/2017CovidMOD4/1/2020
00042/14/2017nullnull
00053/1/2017PermanentMod6/1/2020

 

The result i need would be whats shown in the Portfolio Table, above.

 

Note: My initial DAX formulas found the most recent ModType, but it eliminated the loans that didn't have a mod, but I need a snapshot of all loans:   

 
1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @qbarnes ,

 

Create two column as below.

Column = CALCULATE(MAX('Table'[ModDate]),FILTER('Table','Table'[Leadid]='Table (2)'[Leadid]))

Column 2 = CALCULATE(MAX('Table'[ModType]),FILTER('Table','Table'[ModDate]='Table (2)'[Column]))

Result would be shown as below.

2.PNG 

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

Hi @qbarnes ,

 

Create two column as below.

Column = CALCULATE(MAX('Table'[ModDate]),FILTER('Table','Table'[Leadid]='Table (2)'[Leadid]))

Column 2 = CALCULATE(MAX('Table'[ModType]),FILTER('Table','Table'[ModDate]='Table (2)'[Column]))

Result would be shown as below.

2.PNG 

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Awesome!!  Thank you so much!!

Greg_Deckler
Super User
Super User

@qbarnes - Sounds like you want Lookup Min/Max - https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/m-p/985814#M434


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler

 

Thanks for the assist.   I'm not calculating any numeric values, so how would I transform this portion of the formula, and the references to: 

 

 "__Value",SUM('Table'[Value])

 

I basically need to pull in all loans where MODType and ModDate are applicable, for the entire portfolio.   If a loan never had a Modfication i need to maintain that as a blank value as well, to have a full snapshot of what does and does not have a ModType.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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