Forum Discussion
chapmanbry
6 years agoRegular Visitor
Return value from reference table when multiple criteria match
Need help to accomplish the following. I have the following tables: Reference Table Group Criteria 1 Criteria 2 Criteria 3 HD01 MR HR K, L HD02 MZ RC A, B, C HD03 MS...
- 6 years ago
Hi, chapmanbry
Based on your description, you may create a calculated column or a measure as below. The pbix file is attached in the end.
Calculated column: Re Column = var tab = FILTER( Reference, IF( SEARCH(Production[Results 1],Reference[Criteria 1],,-1)>0, TRUE(),FALSE() )&& IF( SEARCH(Production[Results 2],Reference[Criteria 2],,-1)>0, TRUE(),FALSE() )&& IF( SEARCH(Production[Results 3],Reference[Criteria 3],,-1)>0, TRUE(),FALSE() ) ) return CONCATENATEX( tab, [Group], "," ) Measure: Re Measure = var tab = FILTER( Reference, IF( SEARCH(SELECTEDVALUE(Production[Results 1]),Reference[Criteria 1],,-1)>0, TRUE(),FALSE() )&& IF( SEARCH(SELECTEDVALUE(Production[Results 2]),Reference[Criteria 2],,-1)>0, TRUE(),FALSE() )&& IF( SEARCH(SELECTEDVALUE(Production[Results 3]),Reference[Criteria 3],,-1)>0, TRUE(),FALSE() ) ) return CONCATENATEX( tab, [Group], "," )Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-alq-msft
6 years agoCommunity Support
Hi, chapmanbry
Based on your description, you may create a calculated column or a measure as below. The pbix file is attached in the end.
Calculated column:
Re Column =
var tab =
FILTER(
Reference,
IF(
SEARCH(Production[Results 1],Reference[Criteria 1],,-1)>0,
TRUE(),FALSE()
)&&
IF(
SEARCH(Production[Results 2],Reference[Criteria 2],,-1)>0,
TRUE(),FALSE()
)&&
IF(
SEARCH(Production[Results 3],Reference[Criteria 3],,-1)>0,
TRUE(),FALSE()
)
)
return
CONCATENATEX(
tab,
[Group],
","
)
Measure:
Re Measure =
var tab =
FILTER(
Reference,
IF(
SEARCH(SELECTEDVALUE(Production[Results 1]),Reference[Criteria 1],,-1)>0,
TRUE(),FALSE()
)&&
IF(
SEARCH(SELECTEDVALUE(Production[Results 2]),Reference[Criteria 2],,-1)>0,
TRUE(),FALSE()
)&&
IF(
SEARCH(SELECTEDVALUE(Production[Results 3]),Reference[Criteria 3],,-1)>0,
TRUE(),FALSE()
)
)
return
CONCATENATEX(
tab,
[Group],
","
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
chapmanbry
6 years agoRegular Visitor
v-alq-msft that works perfectly, thank you!