Forum Discussion
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!
- Anonymous5 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
- amitchandak
Super User
jfvaldes9876 , I am not able to see the column name you are mentioning?
refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8 - selimovd
Most 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] * vResultIf 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 regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic - AnonymousNot 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.