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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Add conditional column using mesure to pic specific value and create new colum

I have created below table using mesure. All working as expected except the values in "Final Value" colum. The requirement is that if -

1. "Pass/Fail" column is = Ok than return "Pass"

2. "Pass/Fail" column is = Errors than return "Fail"

3. "Pass/Fail" column is = In Progress than return "In Progress" 

4. "Pass/Fail" column is = Initial than return "Not Started"

 

Else "In Process"

 

In the below example column value must be "In Process", the code that i have written on the screen for the colum "Filal Status" is incorrectly showing "Initila". Please help! 

 

MurVeman_0-1702843858202.png

 

1 ACCEPTED SOLUTION

Hi, @Anonymous 

 

You can try the following methods.

Column = SWITCH(TRUE(),
SEARCH("OK",[Pass/Fail],,0)<>0,"Pass",
SEARCH("Fail",[Pass/Fail],,0)<>0,"Fail",
SEARCH("In Progress",[Pass/Fail],,0)<>0,"In Progress",
SEARCH("Initial",[Pass/Fail],,0)<>0,"Not Started",
"In Process")

vzhangti_0-1703148335117.png

SEARCH function (DAX) - DAX | Microsoft Learn

 

Best Regards,

Community Support Team _Charlotte

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

5 REPLIES 5
rubinboer
Resolver II
Resolver II

hi @Anonymous 

Try:

yourMeasure = IF( CONTAINSSTRING( 'yourTable'[Pass/Fail], "Errors" ), "Fail" , "In Progress" )
Anonymous
Not applicable

Correction - 

If the "Pass/Fail" value contains "Fail" than it should returm "Fail". 

Hi, @Anonymous 

 

You can try the following methods.

Column = SWITCH(TRUE(),
SEARCH("OK",[Pass/Fail],,0)<>0,"Pass",
SEARCH("Fail",[Pass/Fail],,0)<>0,"Fail",
SEARCH("In Progress",[Pass/Fail],,0)<>0,"In Progress",
SEARCH("Initial",[Pass/Fail],,0)<>0,"Not Started",
"In Process")

vzhangti_0-1703148335117.png

SEARCH function (DAX) - DAX | Microsoft Learn

 

Best Regards,

Community Support Team _Charlotte

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

 

rubinboer
Resolver II
Resolver II

hi @Anonymous 

 

your evaluation is on a different column [MaxFlow], based on yyour requirement you need to evaluate the ["Pass/Fail"] Column.

 

your evaluation will be something else based on your data tho:

Switch ( 'yourcolumn'[Pass/Fail],

"OK" ,"Pass", 

"Errors", "Fail" ,

"In Progress", "In Progress",

"Initial ", "Not Started" ,

"In Process"

)

 

 

Anonymous
Not applicable

@rubinboer 

 

Thanks a lot for replying !

Your solution works, i have another requirement in addition to the one that you have givn to me. If the "Pass/Fail" value contains "Errors" than it should returm "Fail". 

 

For all other combinations\(as displayed on the screen below), it mest me "In Progress"

 

MurVeman_0-1702847867635.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.