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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
AwasthiAyush
Frequent Visitor

IF column A and B have same text then C otherwise D

Hi All,

I want if its 351J in A and B then give me Work Order and if A & B is just number return Cal WO#.

How to get that?

AwasthiAyush_0-1708711534294.png

 

 

 

1 ACCEPTED SOLUTION
PijushRoy
Super User
Super User

Hi @AwasthiAyush 

 

Column =
IF (
    CONTAINSSTRING ( Table[ColA], "351J" ) && CONTAINSSTRING ( Table[ColB], "351J" ),
    Table[WorkOrderNumber],
    Table[Cal WO#]
)

 

 


Let me know if that works for you


If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.

Thanks
Pijush
Linkedin




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





View solution in original post

3 REPLIES 3
PijushRoy
Super User
Super User

Hi @AwasthiAyush 

 

Column =
IF (
    CONTAINSSTRING ( Table[ColA], "351J" ) && CONTAINSSTRING ( Table[ColB], "351J" ),
    Table[WorkOrderNumber],
    Table[Cal WO#]
)

 

 


Let me know if that works for you


If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.

Thanks
Pijush
Linkedin




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Hi @PijushRoy 

 

Thank you for replying but I have these columns coming from different tables and we will need a measure instead of Cal Column I guess. Please see the code and how to get the desired result with this .

 

Final WO# =
IF (
    CONTAINSSTRING ('F4801'[Business Unit], "351J" ) && CONTAINSSTRING ( 'F4311'[Cost Center], "351J" ),
    'F4801'[WorkOrderNumber],
    'F4311'[Cal WO#]
)

@AwasthiAyush 

Please create a pbix that contains sample data but still reflects your semantic model (tables, relationships, calculated columns, and measures). Upload the pbix to OneDrive, Google Drive, or dropbox and share the link in this thread. If you are using a spreadsheet to create/import the sample data instead of the manual import method, share the spreadsheet as well. 




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.