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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
JamesGordon
Helper II
Helper II

Sum of data in certain rows

Hi,

 

I am new to Power Bi and DAX and hoping someone can help with the following please.

 

I am trying to create a DAX to calculate the sum of stock that has been allocated for sale. In our data set we have columns with "Cost price" and "allocated to" the "allocated to" column contains the customer account numbers so they are all different . I am trying to calculate the sum of the "cost value" if there is data in the "allocated to" column. Is this possible?

 

Any advice would be appreciated!

 

Regards,

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @JamesGordon 

 

Total allocated cost=Calculate(Sum(table[Cost]),filter(table,table[Allocated to] <> blank()))

Total UNallocated cost=Calculate(Sum(table[Cost]),filter(table,table[Allocated to] = blank()))

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

please share some sample data and expected output.

 

Thanks,

Pravin

Hi,

 

I have attached an illustration that will hopefully make it clearer - let me know if more detail is required.Power Bi Ques.jpg

Anonymous
Not applicable

Hi @JamesGordon 

 

Total allocated cost=Calculate(Sum(table[Cost]),filter(table,table[Allocated to] <> blank()))

Total UNallocated cost=Calculate(Sum(table[Cost]),filter(table,table[Allocated to] = blank()))

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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.