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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Divide a column by sum of another column

Using the following formula for a calculated column:

Capture.JPG

I am expecting to get 1200/44 = $27.3 for both rows.

Total Freight and Admin column is a simple column taken straigh from a dataset (no calculation there).

Quantity column is summing per transaction.

Capture.JPG

Any suggestion? @parry2k 

5 REPLIES 5
MFelix
Super User
Super User

Hi @Anonymous ,

Try the following measure:

measure = SUM(TABLE[Total Freigth and Admin]) / CALCULATE([Quantity] ; ALL(Table[Transaction ID]))

Regards,
MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





TomMartens
Super User
Super User

Hey,

 

my DAX column is looking like this, basically it's quite similar to the DAX statement you provided:

Column = 
var theQuantity = SUM('Table2'[quantity])
return
DIVIDE('Table2'[freight],theQuantity)

and my sample data looks like this, also similar to yours, but with your expected result:

image.png

 

So there might be a difference. can you please explain what you mean by "Quantity column is summing by transaction".
If quantity is a column then SUM('tablename'[quantity] will calculate across all rows of the table as there is no filtercontext present.

 

Regards,
Tom

 

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

Hello @ 

 

 

 

Hey,

can you please provide a pbix file, either your original one, or one that contains sample data but enables us to recreate the issue you are facing. Upload the file to onedrive or dropbox and share the link.

Regards,
Tom


Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

I uploaded the simplified file to dropbox. Here is the link @TomMartens 

 

https://www.dropbox.com/s/so6h2h0xz192ngg/Demo.pbix?dl=0

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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