Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Result if only multi values match

Hi Experts, 

I'm stuck! 

I have the data below, and need 'Result' column to show "yes" if,

Scode = BBB,

& IF icode matches another cell in icode &,

if Lcode matches both rows, &,

if Ocode on a matching row  = anything but 0. 

I also want 'Result 2' column to show the Ocode that matches on all 'Result' comlum "yes"... 

I have shown the results below...  

I hope this is possible!  Thanks in advance  PBI experts. 

 

 

ScodeicodeLcodeOcodeResultResult 2
BBBXABC0yes123
BBBCABC0yes123
BBBVABC0no0
BBBBABC0no0
BBBXABC123yes123
BBBCABC123yes123
BBBVABC0no0
BBBBABC0no0
BBBXCDE0no0
BBBCCDE0no0
BBBVCDE0yes456
BBBBCDE0yes456
BBBXCDE0no0
BBBCCDE0no0
BBBVCDE456yes456
BBBBCDE456yes456
1 ACCEPTED SOLUTION
d_gosbell
Super User
Super User

I'm assuming that you want to calculate this as a calculated column, not a measure as from what I can see it probably only makes sense at the row level. If this is correct I think the following 2 expressions should work

 

Result Column = 
VAR _currentIcode = Table1[icode]
var _currentLcode = Table1[Lcode]
VAR _table = FILTER(Table1, Table1[icode] = _currentIcode && Table1[Lcode] = _currentLcode && Table1[Ocode] <> 0)
return if( COUNTROWS(_table) > 0, "yes", "no")
Result2 Column = 
VAR _currentIcode = Table1[icode]
var _currentLcode = Table1[Lcode]
VAR _table = FILTER(Table1, Table1[icode] = _currentIcode && Table1[Lcode] = _currentLcode && Table1[Ocode] <> 0)
return CONCATENATEX( _table, [Ocode], ",")

View solution in original post

2 REPLIES 2
d_gosbell
Super User
Super User

I'm assuming that you want to calculate this as a calculated column, not a measure as from what I can see it probably only makes sense at the row level. If this is correct I think the following 2 expressions should work

 

Result Column = 
VAR _currentIcode = Table1[icode]
var _currentLcode = Table1[Lcode]
VAR _table = FILTER(Table1, Table1[icode] = _currentIcode && Table1[Lcode] = _currentLcode && Table1[Ocode] <> 0)
return if( COUNTROWS(_table) > 0, "yes", "no")
Result2 Column = 
VAR _currentIcode = Table1[icode]
var _currentLcode = Table1[Lcode]
VAR _table = FILTER(Table1, Table1[icode] = _currentIcode && Table1[Lcode] = _currentLcode && Table1[Ocode] <> 0)
return CONCATENATEX( _table, [Ocode], ",")
Anonymous
Not applicable

Hi @d_gosbell  - this solution works perfectly.   A huge thank you for your time! 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.