Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Jay20024
Helper I
Helper I

MAX of sum per service

Hi Folks,

 

Had a horizontal bar chart showing the SUM of transaction cost for each service.

I'd like to calculate the amount of the most expensive service (here it's "compute") in dax.

As MAX only refers to a column, 

How can I do that ? I thank you in advance folks !

 

MAX of SUM.PNG

 

1 ACCEPTED SOLUTION

ok I found it  : with top N function :

= SUMX( TOPN( 1, SUMMARIZE( InternetSales, InternetSales[ProductKey], "TotalSales", SUM(InternetSales[SalesAmount]) ), [TotalSales], DESC ), [TotalSales] )

View solution in original post

5 REPLIES 5
techies
Super User
Super User

Hi @Jay20024 please check this

 

MaxServiceCost =
MAXX (
    SUMMARIZE ( 'Table', 'Table'[Service], "TotalCost", SUM('Table'[Transaction Cost]) ),
    [TotalCost]
)
― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

Let me precise how my dataset works. Hope it will be clearer. I'd like to find 200 through a dax measure.MAX of SUM.PNG

ok I found it  : with top N function :

= SUMX( TOPN( 1, SUMMARIZE( InternetSales, InternetSales[ProductKey], "TotalSales", SUM(InternetSales[SalesAmount]) ), [TotalSales], DESC ), [TotalSales] )

mdaatifraza5556
Super User
Super User

Hi @Jay20024 

Is this the result you want?

 

Screenshot 2025-03-28 162356.png

 




If this answers your questions, kindly accept it as a solution.
If this is helpful, then please give kudos.

You gave a good clue  !

= SUMX( TOPN( 1, SUMMARIZE( InternetSales, InternetSales[ProductKey], "TotalSales", SUM(InternetSales[SalesAmount]) ), [TotalSales], DESC ), [TotalSales] )

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.