Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 |
---|---|
25 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
25 | |
12 | |
11 | |
10 | |
6 |