Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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])
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
97 | |
82 | |
74 | |
66 |
User | Count |
---|---|
120 | |
105 | |
99 | |
81 | |
72 |