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
Anonymous
Not applicable

Extract text by filtering max numeric column

Hi folks,

 

From the below table, how can I extract Company performance by max Year ID from Table B?

suhassol_0-1603282965617.png

suhassol_1-1603283032526.png

 

So here I need Company performance extracted to Table A by filtering the MAX year ID. Also, if max year ID is not available for Company ID I need to assign it as "Data N/A".

 

EXPECTED OUTPUT:

suhassol_2-1603283108275.png

 

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Create a new column in table1

new column =
var _max = maxx(filter(table2, table1[company id] = table2[company id]),table2[year id])
return
maxx(filter(table2, table1[company id] = table2[company id] && table2[year id] =_max),table2[company performace])

Anonymous
Not applicable

Hey @amitchandak ,

 

Thanks for the quick help, I also need help to update the query to "Data N/A" when there are no Company Performance values when there is no max YearID for the given company ID.  

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.