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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
THENNA_41
Post Partisan
Post Partisan

Compare two columns and create new column based the compare the columns

I have two column  one Column confirmation  and another column Timing 

 

Confirmation column have  below three values 

1.Confirmation  

2.Not Confirmed 

3.Pending 

 

 

Confirmation  as consider   No Risk 

Not Confirmed  as Consider  Risk 

Pending  as consider No Risk

 

Timing  column have a following the  values .

 

Overdue Purchase Requisition  consider as   Risk

 

Standard Overdue consider   as Risk

 

Urgent Overdue consider as Risk

 

Urgent  consider as Risk

 

Lack  consider as Risk

 

No Timing Risk Consider as  Risk

 

Now i want to create new calculated column name  called  RISK.  this column would be a logical result of previous two columns.

i have assign two values for the following conditions 

 

    • Risk – used when this delivery is flagged as one of the Risk statuses in either Confirmation column or Timing column
    • No Risk - used when this delivery is flagged as No Risk statuses in both Confirmation column and Timing column

i have created condition its not working . any support . looking for support. 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@THENNA_41 , Create a new column like

 

new column =
Var _1 =
Switch([Confirmation],
"Confirmation","No Risk",
"Not Confirmed","Consider Risk",
"Pending","No Risk",
"No Risk")

Var _2 =
Switch( true(),
[Timing] in {"Overdue Purchase Requisition","Standard Overdue","Urgent Overdue","Urgent","Lack","No Timing Risk"}, "Risk",
"No Risk"
)
return
if(_1 ="Nor Risk" && _2 = "No Risk", "No Risk", "Risk")

View solution in original post

5 REPLIES 5
THENNA_41
Post Partisan
Post Partisan

@amitchandak  sir its showing all the values as Risk and there  No Risk value also there. No Timing Risk is a consider as a No Risk and . if this value match with confirmation column   Pending ,confirmation . its should return No Risk 

@THENNA_41 , return has one spell mistake, Check that in formula

return

if(_1 ="Not Risk" && _2 = "No Risk", "No Risk", "Risk")

ValtteriN
Super User
Super User

Hi,

Try something like this: IF(OR(Table[Confirmation] in {"Confirmation", "Not Confirmed"},Table[Timing] <> "No Timing Risk"),"Risk","No Risk")

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




serpiva64
Super User
Super User

Please, 

can you share an exemple of teh file?

amitchandak
Super User
Super User

@THENNA_41 , Create a new column like

 

new column =
Var _1 =
Switch([Confirmation],
"Confirmation","No Risk",
"Not Confirmed","Consider Risk",
"Pending","No Risk",
"No Risk")

Var _2 =
Switch( true(),
[Timing] in {"Overdue Purchase Requisition","Standard Overdue","Urgent Overdue","Urgent","Lack","No Timing Risk"}, "Risk",
"No Risk"
)
return
if(_1 ="Nor Risk" && _2 = "No Risk", "No Risk", "Risk")

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors