Forum Discussion

nok's avatar
nok
Advocate II
1 year ago
Solved

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...
  • Anonymous's avatar
    Anonymous
    1 year ago

    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:

    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.

    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.