Forum Discussion

jfvaldes9876's avatar
jfvaldes9876
New Member
5 years ago
Solved

Multiply 2 columns from different tables

Hi everyone!

 

I want to know how can I multiply 2 different columns (Q and Price), of different tables. Both tables have 3 columns:

-Date (D-M-Y)

-Hour

-Q (HP CHACAYES) or Price (BA S/E SAUZAL)

So my question is How to get a new column, that is called "Revenues", and is the result of the product between Q*Price, for each hour-day-month-year. 

I am begginer on Power  BI, so any help is well received!!

 

Thanks!

 

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi jfvaldes9876 ,

     

    You can merge like

    Then expand the table to get the result. Now you can simply multiply the two columns together.

     

    Calculated column: 

    Column = [Price]*[Table.Q]

    Measure:

    Measure = MAX('Merge1'[Price])*MAX('Merge1'[Table.Q])

     

     

     

     

    Best Regards,

    Stephen Tao

     

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

3 Replies

  • selimovd's avatar
    selimovd
    Icon for Most Valuable Professional rankMost Valuable Professional

    Hey jfvaldes9876 ,

     

    yes, sure. You can filter the values from the other table by the values of the row.

    Try the following approach:

    Sales =
    VAR vRowFecha = FirstTable[fecha_opreal]
    VAR vRowHora = FirstTable[hora_operal]
    VAR vResult =
        CALCULATE(
            SUM( SecondTable[BA S/E SAUZAL 110KV SECCION 1] ),
            SecondTable[fecha] = vRowFecha,
            SecondTable[hora] = vRowHora
        )
    RETURN
        FirstTable[HP CHACAYES] * vResult

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi jfvaldes9876 ,

     

    You can merge like

    Then expand the table to get the result. Now you can simply multiply the two columns together.

     

    Calculated column: 

    Column = [Price]*[Table.Q]

    Measure:

    Measure = MAX('Merge1'[Price])*MAX('Merge1'[Table.Q])

     

     

     

     

    Best Regards,

    Stephen Tao

     

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