cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
suhassol
Helper I
Helper I

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

@suhassol , 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])

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.