Forum Discussion
Creating a measure using two different column from different table
- 4 years ago
Hi Anonymous ,
Refer the below:
sumtablea = CALCULATE(SUM(TableA[value]),ALLEXCEPT(TableA,TableA[Product]))sunmtableb = calculate(SUM(TableB[value]),ALLEXCEPT(TableB,TableB[Product]))Relationship:
Difference:
Difference = [sumtablea]-LOOKUPVALUE(TableB[sunmtableb],TableB[Product],MAX(TableA[Product]))Outputresult:
Did I answer your question? Mark my post as a solution!
Best RegardsLucien
Anonymous use the same process that you do to create a calculated column and a measure
1. first create a calculated columns
2. create your first measure
3. then create your measure to calc difference between 1. calculated column 2. measure
in case you face any challenge, please sample data to create above calc
Hi negi007,
I tried creating the same but nothing is working out.
It gives error "a table of multiple values was supplied where a single value was expected" when i used Lookup value fucntion to call Calculated COlumn value inn Table 1.
Can you please elaborate some more?
Thanks.
A
- negi0074 years agoCommunity Champion
Anonymous why do you need to use lookup function. both tables are already linked to each other through relationship you have created as mentioned by you.
let say you first create a calculated column like
1. Profit_Est = Orders[Profit]*1.5then you create a measure in the second table like below2. Returns = sum(Returns[value])then you create a measure like belowProfit_Returns = SUM(Orders[Profit_Est])-[Returns]i hope it can direct you in the right direction. for exact help would it be possible for you to share your pbix file or data in text format. thanks