Forum Discussion
Anonymous
4 years agoNot applicable
Fetch the values from another table by matching column x with eith column A or B in the other table
Hello I need the values from table 1 by matching column x in table 1 with either column a or column b in table 2. I tried to establish two relationships with table 1 to table 2 but I can only ma...
- 4 years ago
That would be someting like this.
Values = CALCULATE ( SUM ( 'Table 2'[Values] ), FILTER ( ALL ( 'Table 2'[ENPNSC_] ), 'Table 2'[ENPNSC_] = 'Table 1'[Enpnsc_Calculated] ) ) + CALCULATE ( SUM ( 'Table 2'[Values] ), FILTER ( ALL ( 'Table 2'[ENPNSC_] ), 'Table 2'[ENPNSC_] = 'Table 1'[Pcsc_calcualted] ) )
jdbuchanan71
Super User
4 years agoTry it like this instead.
Value =
VAR _search = 'Table 1'[column x]
RETURN
COALESCE (
CALCULATE (
FIRSTNONBLANK ( 'Table 2'[value], 1 ),
FILTER ( ALL ( 'Table 2'[column a] ), 'Table 2'[column a] = _search )
),
CALCULATE (
FIRSTNONBLANK ( 'Table 2'[value], 1 ),
FILTER ( ALL ( 'Table 2'[column b] ), 'Table 2'[column b] = _search )
)
)
- bhavana0974 years agoFrequent Visitor
Hello jdbuchanan71
I'm sorry to revert again,
That is just picking first value in the column, i would like to pick every value
For instance :Table 1 should be able to pick all the values in table 2 via matching either enpnsc_calculated field & ecpc_calculated field with table 2 [ ENPNSC_ ] field
Thank you very much in advance