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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
nok
Helper III
Helper III

Create weighted calculation in a visual table

Hello,

I have two different measures in my visual table: qtd_itens and run_fx, which perform their respective calculations per Buyer in my visual table.

I want to create a new column in this visual table that would be the value of a measure that does what the image below exemplifies:

visual_table.png

 

This new measure would be:
divide the qtd_itens of the buyer in that row by the total qtd_itens and then take this result and multiply it by the run_fx of that buyer.

 

How can I make this measure so that it works in my visual table?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from lbendlin , please allow me to provide another insight:

Hi, @nok 

Regarding the issue you raised, my solution is as follows:

1.First I have created the following table and the column names and data are the data you have given:

vlinyulumsft_0-1729750423506.png

2. Below are the measure I've created for your needs:

Measure = 
VAR to1=CALCULATE([qtd_itens],ALLSELECTED('Table'))
VAR c1=[qtd_itens]
VAR c2=[run_fx]
RETURN DIVIDE(c1,to1)*c2

3.Here's my final result, which I hope meets your requirements.

vlinyulumsft_1-1729750480251.png

As our qtd_itens and run_fx measures may differ, I cannot guarantee that my code will fully meet your requirements. I recommend adjusting it according to your actual measures.

 

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thanks for the reply from lbendlin , please allow me to provide another insight:

Hi, @nok 

Regarding the issue you raised, my solution is as follows:

1.First I have created the following table and the column names and data are the data you have given:

vlinyulumsft_0-1729750423506.png

2. Below are the measure I've created for your needs:

Measure = 
VAR to1=CALCULATE([qtd_itens],ALLSELECTED('Table'))
VAR c1=[qtd_itens]
VAR c2=[run_fx]
RETURN DIVIDE(c1,to1)*c2

3.Here's my final result, which I hope meets your requirements.

vlinyulumsft_1-1729750480251.png

As our qtd_itens and run_fx measures may differ, I cannot guarantee that my code will fully meet your requirements. I recommend adjusting it according to your actual measures.

 

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Simply amazing! This is exactly what I wanted to do.

Thank you very much, @Anonymous 

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information. Do not include anything that is unrelated to the issue or question.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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