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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors