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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Idonotknowthis
New Member

IF Function with multiple conditions

Hello, everyone! New here, so any help is appreciated...

I have:  

Table 1

CaseID
a556kk
b67rgg
v0102g
f384kk
b68rga
c456gk

 

Table 2

CaseIDRelatedBug-IDTypeOfBug
a556kk0023technical
b67rgg0014reqtype
b68rga0018nontech
c456gk0045other

 

I want to create a new column in Table 1 that will return "Yes" only if the CaseID from Table1 is found in Table2, and is responsive to "nontech" and "reqtype" only. Otherwise (CaseID is not found in Table2 or is found but the TypeOfBug is "technical" or "other") to return "No": 

Table 1 

CaseIDAssociatedReq?
a556kkNo
b67rggYes
v0102gNo
f384kkNo
b68rgaYes
c456gkNo

How can I do that? I assume it's with IF function. Thanks in advance to everyone who contributed!

2 ACCEPTED SOLUTIONS
Daniel29195
Community Champion
Community Champion

@Idonotknowthis 

output 

Daniel29195_0-1707502235298.png

 

calculated column : 

Column = 
var ds = 
FILTER(tbl_2,
tbl_2[CaseID] = tbl_1[CaseID] && (tbl_2[TypeOfBug] = "nontech" || tbl_2[TypeOfBug] = "reqtype")) 

RETURN
if( ISEMPTY(ds), "NO", "YES")

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution to help other people to find it more quickly . 

 

View solution in original post

Anonymous
Not applicable

Hi @Idonotknowthis ,
@Daniel29195 Great solution, here's mine.

AssociatedReq = 
IF(
    CALCULATE(
        COUNTROWS(Table2),
        FILTER(
            Table2,
            Table2[CaseID] = EARLIER(Table1[CaseID]) &&
            (Table2[TypeOfBug] = "nontech" || Table2[TypeOfBug] = "reqtype")
        )
    ) > 0,
    "Yes",
    "No"
)

Final output

vheqmsft_0-1707725846059.png

 

Best regards,

Albert He

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Idonotknowthis ,
@Daniel29195 Great solution, here's mine.

AssociatedReq = 
IF(
    CALCULATE(
        COUNTROWS(Table2),
        FILTER(
            Table2,
            Table2[CaseID] = EARLIER(Table1[CaseID]) &&
            (Table2[TypeOfBug] = "nontech" || Table2[TypeOfBug] = "reqtype")
        )
    ) > 0,
    "Yes",
    "No"
)

Final output

vheqmsft_0-1707725846059.png

 

Best regards,

Albert He

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Thanks for sharing another way of dealing with such tasks! Works perfectly

Daniel29195
Community Champion
Community Champion

@Idonotknowthis 

output 

Daniel29195_0-1707502235298.png

 

calculated column : 

Column = 
var ds = 
FILTER(tbl_2,
tbl_2[CaseID] = tbl_1[CaseID] && (tbl_2[TypeOfBug] = "nontech" || tbl_2[TypeOfBug] = "reqtype")) 

RETURN
if( ISEMPTY(ds), "NO", "YES")

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution to help other people to find it more quickly . 

 

Thank you! It works perfectly! 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors