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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Table Total Sum with Filters

Hello Everyone. 

 

I got stuck in a Table Total wich is not summarizing my rows.

 

I want to sum total sales by each invoice number filtering the last negotiation number. I have to consider only the last one, the highest negotiation number.

 

I tried a SUMX, filtering the last negotiation as MAX(negotiation number), then the table returns only the last negotiation sale amount. 

I want to sum the last column 'SUM' considering the hightest negotioation number by each invoice number. 

 

Any ideas how to filter this? 

 

Thanks in advance!

 

 

RodrigoBSC_1-1643632331828.png

 

 

RodrigoBSC_0-1643631895348.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try a measure like

 

sumx(values(Table[Invoice]), calculate(lastnonbalnkvalue(Table[negotiation number], sum(Table[Sales]))))

 

or

calculate(sumx(values(Table[Invoice]), calculate(lastnonbalnkvalue(Table[negotiation number], sum(Table[Sales])))) ,

filter(allselected(Table), Table[Invoice] = max(Table[Invoice]) ) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try a measure like

 

sumx(values(Table[Invoice]), calculate(lastnonbalnkvalue(Table[negotiation number], sum(Table[Sales]))))

 

or

calculate(sumx(values(Table[Invoice]), calculate(lastnonbalnkvalue(Table[negotiation number], sum(Table[Sales])))) ,

filter(allselected(Table), Table[Invoice] = max(Table[Invoice]) ) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak thank you very much! It worked pretty well here and solved my problem. 

Really appreciate the fast reply and with a very good solution for this. Thank you!

 

Just by the way, for any case, is it possible to aggregate also the blank values in last negotiation? 

Like a condition. Sum sales with all blank values in last negotiation and, if there is a number, consider only the hightest in negotiation number. 

This is just an extra thought and I will be working on that also. 

 

One more time, thanks for the help. It really helped to solve this problem.  

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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