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 September 15. Request your voucher.

Reply
macwhe
Helper I
Helper I

SUMX and Summarize

Hi All,

 

I am trying to use SUMX with Summarize however my result is not correct .Below it is a example of the data.

The expected result is to have amount =500 on line 4 , however my measure gives me 1000 as result.

MY Measure=Calculate(SUMX(SuMMARIZE(Table, Facture,Prod ID,Amount),SUM(Amount), Filter (table(And(MAX Prod ID= PROD ID, MAX(Lineid))))

 

Many Thanks in advance

MAX Prod IDFactureAmountProd IDLine ID
14INV120011
14INV130022
14INV1500143
14INV1500144
1 ACCEPTED SOLUTION
Tahreem24
Super User
Super User

@macwhe ,

First create one Calculated column to make Max of Line ID like below:

Max LineID =  IF(MAX('Table'[Line ID])='Table'[Line ID],1,0)
Then create your final measure to get the expected result:

Final Measure = CALCULATE(SUM('Table'[Amount]),FILTER('Table',AND(('Table'[Prod ID]='Table'[MAX Prod ID]),'Table'[Max LineID]=1)))
Capture.PNG
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

1 REPLY 1
Tahreem24
Super User
Super User

@macwhe ,

First create one Calculated column to make Max of Line ID like below:

Max LineID =  IF(MAX('Table'[Line ID])='Table'[Line ID],1,0)
Then create your final measure to get the expected result:

Final Measure = CALCULATE(SUM('Table'[Amount]),FILTER('Table',AND(('Table'[Prod ID]='Table'[MAX Prod ID]),'Table'[Max LineID]=1)))
Capture.PNG
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

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.