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
SearchingYT
Frequent Visitor

LOOKUPVALUE returning multiple values - I want to grab the largest value

Hi Power BI experts,

 

I have a simple question regarding lookupvalue function returning multiple values.

 

How can I code it to return the highest of those multiple values only. In my case it is a date, and I want it to return the latest date.

 

Thanks

1 ACCEPTED SOLUTION
SearchingYT
Frequent Visitor

I was able to solve this using CALCULATE function, taking the max of my date column and filtering lookup result;


Calculate(max(table.dateColumn), filter(table, table.id = mytable.id))

Hope this helps someone.

View solution in original post

3 REPLIES 3
SearchingYT
Frequent Visitor

I was able to solve this using CALCULATE function, taking the max of my date column and filtering lookup result;


Calculate(max(table.dateColumn), filter(table, table.id = mytable.id))

Hope this helps someone.

It worked perfectly for me, I used it with average instead of max, great contribution.

 

johnt75
Super User
Super User

Rather than LOOKUPVALUE you can use SELECTCOLUMNS .. TOPN, e.g.

Max Value =
SELECTCOLUMNS ( TOPN ( 1, 'Table', 'Table'[Date] ), "@val", 'Table'[Date] )

In the event that you have multiple entries with the same date then you would need to add another column to the TOPN ranking to ensure only a single value is returned, ideally a unique identifier column or an index column added through Power Query

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.