gr33ns
gr33ns

Reputation: 83

How do I create a measure in Power Pivot that pulls a value from another table?

I have two tables that use a unique concatenated column for their relationship. I simply want to make a measure that uses the values from C4 of Table1. I thought I could use a simple formula like =values(Table1[C4]) but I get an error of "A table of multiple values was supplied where a single value was expected."

Side note: I realize the concatenation is unnecessary here in this simple example, but it is necessary in the full data I am working with which is why I added it into this example.

Here's a simplified set of tables for what I am trying to do:

Table1

enter image description here

Table2

enter image description here

Relationships

enter image description here

Upvotes: 0

Views: 2020

Answers (2)

Angelo Canepa
Angelo Canepa

Reputation: 1781

You can use context transition to retrieve the value.

= CALCULATE(MAX(Table1[C4])

Upvotes: 0

mxix
mxix

Reputation: 3659

First you should think. Do I really need a Calculated column? Can't this be calculated at runtime?

But if you still want to do it, you can use RELATED or RELATEDTABLE.

Keep in mind if you are pulling from RELATEDTABLE, returns many values. So you should apply some type of aggregation like SUMX or MAXX.

Upvotes: 2

Related Questions