The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
I have a table (A) with a column for a date month, and a column with a static value per each month.
On the other hand, I have a table (B) cost and date month.
I want to create a new calculated column as follow:
Column = A[staticValue]*B[cost].
Example:
A
02/2021 23.4
03/2021 3.5
B
02/2021 2500
03/2021 1400
CalcultatedColum:
23.4*2500
3.5*1400
Thank you in advance
Solved! Go to Solution.
Hi @jmmariscal
you can create a relationship between the two tables using month-year column from both tables. It looks from the example you've provided that this relationship shall be one-one relationship.
then you can use the following code to create the calculated column:
If the coulm is in table A:
Column = A[staticValue] * RELATED ( B[cost] )
if the column is in table B:
Column = B[cost] * RELATED ( A[staticValue] )
please try to create the relationship and let me know if you need any help.
Hi @jmmariscal
you can create a relationship between the two tables using month-year column from both tables. It looks from the example you've provided that this relationship shall be one-one relationship.
then you can use the following code to create the calculated column:
If the coulm is in table A:
Column = A[staticValue] * RELATED ( B[cost] )
if the column is in table B:
Column = B[cost] * RELATED ( A[staticValue] )
please try to create the relationship and let me know if you need any help.
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
7 | |
7 |