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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors