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.
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 make one relationship active
I have a column in table 1 that either matches column a in table 2 or column b in table 2.
Is there any better way to bring in all the values matching column a or column b
Solved! Go to Solution.
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]
)
)
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]
)
)
Try 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 )
)
)
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
Hello @jdbuchanan71
Thank you for the solution, But i got an error back saying "mutliple values was supplied where single values are being expected".
Im sorry, i Forgot to mention that for one value in column a (enpnsc) & column b(pcsc) from table1 has the mutiple value in column x( enpnsc) table 2
Targeted value is agency cost
Im looking forward to discussing with you
@Anonymous
You can add a column to table 1 like this.
Value =
COALESCE(
LOOKUPVALUE('table 2'[value],'table 2'[column a],'table 1'[column x]),
LOOKUPVALUE('table 2'[value],'table 2'[column b],'table 1'[column x])
)
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
72 | |
38 | |
31 | |
27 |
User | Count |
---|---|
92 | |
50 | |
44 | |
40 | |
35 |