Forum Discussion

AaronGlenn10's avatar
AaronGlenn10
Icon for Helper III rankHelper III
4 years ago
Solved

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

 

 

 

 

  • Hi,

    This measure should work

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

4 Replies

  • Hi,

    This measure should work

    =FIRSTNONBLANK(TOPN(1,VALUES(Restaurants[Name]),[Total Sales]),1)
    • AaronGlenn10's avatar
      AaronGlenn10
      Icon for Helper III rankHelper III

      Ashish:

       

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

       

      ~A

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Icon for Super User rankSuper User

        You are welcome.  Please mark that reply as Answer.  Try this measure

        =MAXX (Restaurants,[Total Sales])