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! Learn more

Reply
Anonymous
Not applicable

Sum based on column (different grannularities)

Doc numberDateCustomerSalesTOTAL SALES per customer
101/01/2021Microsoft100600
202/01/2021Apple5050
302/01/2021Microsoft200600
403/01/2021Microsoft300600

 

Hi all,

 

I need help to create a dax formula for the last column.

It takes the sum of all Sales in the column, based on the Customer Name.

Example: for customer "microsoft" it does 100 + 200 + 300 = 600.

 

My "sales" column is in reality also already a measure.

 

Many thanks in advance for your time.

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , Try a new measure like

 

calculate(sum(Table[Sales]), allexcept(Table, Table[Customer]))

 

or

 

calculate(sum(Table[Sales]), filetr(allselected(Table), Table[Customer] = max(Table[Customer])))

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

Hi, 

 

thanks for your reply.

I tried both but they did not work. Both return me the same values as in the sample data column "sales"

This is what I tried: (note: [(€) Turnover CP] is a measure that performs a formula for sales already (it calculates with discounts and quantities and several prices))

 

First option: calculate([(€) Turnover CP]; allexcept(Customer;Customer[Customer]))
Second option: 
calculate([(€) Turnover CP]; filter(allselected(Customer); Customer[Customer] = max(Customer[Customer])))
 

@Anonymous , Please find the attached file after the signature. I created same formula

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

Hi,

 

It works indeed as desired, but I have a memory issue if I perform it on my full dataset :(.

Would you have another idea?

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.