cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Helper III

## Return Max Result by Sales

Power BI Rock Stars:

I have a summary page for restaurant sales where users can select a CITY to review the total of all restaurants within that CITY. Trying to find a measure that will return the name of the restaurant within the SELECTED CITY that reported the highest sales for the current month.  Thank you! ~A

1 ACCEPTED SOLUTION
Super User

Hi,

This measure should work

``=FIRSTNONBLANK(TOPN(1,VALUES(Restaurants[Name]),[Total Sales]),1)``

Regards,
Ashish Mathur
http://www.ashishmathur.com
4 REPLIES 4
Super User

Hi,

This measure should work

``=FIRSTNONBLANK(TOPN(1,VALUES(Restaurants[Name]),[Total Sales]),1)``

Regards,
Ashish Mathur
http://www.ashishmathur.com
Helper III

Ashish:

That worked - thank you!  How would I also return the sales amount (\$) associated with that restaurant?

~A

Super User

``=MAXX (Restaurants,[Total Sales])``

Regards,
Ashish Mathur
http://www.ashishmathur.com
Super User

@AaronGlenn10 , Try TOPN

Top 1= calculate(max(Table[restutant]),TOPN(1,allselected(table[restutant]),[Total Measure],DESC), values(table[restutant]))