cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Daven
Helper II
Helper II

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 @Daven 

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 @Daven 

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!


Thanks Phil! 

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

Power BI Dev Camp Session 22 with aka link 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!