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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
JamesMoody
Frequent Visitor

Custom Column with multiple if statements

I am wanting to add a column to my data to determine when a call is abandoned. Here is my currrent formula and the result I am getting.

 

Formula:  Column = IF('Table1'[Participant] = "agent", IF('Table1'[Segment] <> "interact", "Abandoned"))

 

Current Result:

Record IDParticipantSegmentCurrent Result
1agentalertAbandoned
1ivrivr 
1acdinteract 
1acddelay 
1customerinteract 
2agentwrapupAbandoned
2agentinteract 
2agentalertAbandoned
2acdinteract 
2acddelay 
2ivrivr 
2customerinteract 

 

I would like the result to be as per below - only counting records as Abandoned if one of the participants is an 'agent' and there is only the one segment for 'alert'

 

Expected Result:

Record IDParticipantSegmentExpected Result
1agentalertAbandoned
1ivrivr 
1acdinteract 
1acddelay 
1customerinteract 
2agentwrapup 
2agentinteract 
2agentalert 
2acdinteract 
2acddelay 
2ivrivr 
2customerinteract 
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1710291804500.png

 

 

Expected Result CC =
VAR _recordid = Table1[Record ID]
VAR _list =
    CALCULATETABLE (
        Table1,
        Table1[Record ID] = _recordid,
        Table1[Participant] = "agent",
        Table1[Segment] <> "alert"
    )
RETURN
    IF ( COUNTROWS ( _list ) = 0 && Table1[Segment] = "alert", "Abandoned" )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1710291804500.png

 

 

Expected Result CC =
VAR _recordid = Table1[Record ID]
VAR _list =
    CALCULATETABLE (
        Table1,
        Table1[Record ID] = _recordid,
        Table1[Participant] = "agent",
        Table1[Segment] <> "alert"
    )
RETURN
    IF ( COUNTROWS ( _list ) = 0 && Table1[Segment] = "alert", "Abandoned" )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Thanks, this solved my issue!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.