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
buttercream
Helper II
Helper II

Weighted Average Measure

How do I create a measure that will calculate the weight of an amount relative to a category or multiple categories?

 Example below I'd like a measure to calculate the weight of each payment = payment/sum of payments but have one measure for the two columns below.

 

CustomerPaymentWeighted Payments by CustomerWeighted Payments Total
Jim$1,00013.89%11.76%
Jim$1,20016.67%14.12%
Jim$5,00069.44%58.82%
Bob$50038.46%5.88%
Bob$80061.54%9.41%
1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @buttercream ,

 

I assume that you have additional information for this visualization in this case I added an ID column just to get the correct syntax add the following two measures:

Weighted Payments Total = DIVIDE(SUM('Table'[Payment]), CALCULATE(SUM('Table'[Payment]), REMOVEFILTERS('Table'[Customer],'Table'[ID])))

Weighted Payments by Customer = DIVIDE(SUM('Table'[Payment]), CALCULATE(SUM('Table'[Payment]), REMOVEFILTERS('Table'[ID])))

 

MFelix_0-1767195560818.png

 

 

Be aware that you may need to change this accordingly to your model and visualization.


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





View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

There has to be at least one additional column in the visual to avoid aggregation at the Customer level.  Once you drag that column as well, you can either write measures or use visual calculations.  To receive specific help, share that additional column as well.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
MFelix
Super User
Super User

Hi @buttercream ,

 

I assume that you have additional information for this visualization in this case I added an ID column just to get the correct syntax add the following two measures:

Weighted Payments Total = DIVIDE(SUM('Table'[Payment]), CALCULATE(SUM('Table'[Payment]), REMOVEFILTERS('Table'[Customer],'Table'[ID])))

Weighted Payments by Customer = DIVIDE(SUM('Table'[Payment]), CALCULATE(SUM('Table'[Payment]), REMOVEFILTERS('Table'[ID])))

 

MFelix_0-1767195560818.png

 

 

Be aware that you may need to change this accordingly to your model and visualization.


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





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.