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

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

Reply
Anonymous
Not applicable

Conditional Column

Hi,

 

I have table and would like to create a column with below logic. I am using directquery so unable to use add column function under the transform data. 

 

If status="not ready" then use reason code from ReasonCode column else use the Status. 

 

Agent      Status   ReasonCode     ***New column needed
1     Ready       Ready
2     Not Ready   Break       Break
3     Not Ready   Meeting        Meeting

 

Thanks,

 

Daven 

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @Anonymous 

Try this

Column = IF( CONTAINSSTRING('Table'[Status], "Not Ready"), 'Table'[ReasonCode], 'Table'[Status])

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

2 REPLIES 2
PhilipTreacy
Super User
Super User

Hi @Anonymous 

Try this

Column = IF( CONTAINSSTRING('Table'[Status], "Not Ready"), 'Table'[ReasonCode], 'Table'[Status])

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

Thanks Phil! 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.