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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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