Forum Discussion
KG1
4 years agoResolver I
Nested If / And Statement
Hi I have had the following formula sent to me in Excel - could you please advise how I would go about replicating this in a column? I am really not expecting anyone to retype this out for me...
- Anonymous4 years ago
Hi KG1 ,
I created some data:
Here are the steps you can follow:
1. Create calculated column.
Column = SWITCH( TRUE(), 'Table'[CD1]="TRUE"&&'Table'[P1]="TRUE"&&'Table'[P3]="TRUE"&&'Table'[Q1]="TRUE"&&'Table'[T1]="TRUE"&&'Table'[T3]="TRUE" || AND('Table'[AC1]="TRUE",'Table'[AC2]="TRUE") ,"Receipting")2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
amitchandak
4 years agoSuper User
KG1 , You can use Switch with True, that will simplify it. Alos use column name in place of cell name
refer if this can help
Switch-Case statement of #PowerBI: https://www.youtube.com/watch?v=gelJWktlR80&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=56
KG1
4 years agoResolver I
Great - thank you - is it a new switch at the start of each new IF e.g
Test = switch ( True (),( [CD1] = "TRUE" && [P1] = "TRUE" && [P3] = "TRUE" && [Q1] = "TRUE" && [Q3] ="TRUE" && [T1] = "TRUE" && [T3] = "TRUE" ) ||[AC1] = "TRUE" && [AC2] = "TRUE" , "Receipting" , switch ( True (), [CD1] = "TRUE" && [CD2] = "TRUE" && [P2] = "TRUE" && [Q1] = "TRUE" && [Q4 - Positive] ="TRUE" && [R2] = "TRUE" && [S1] = "No" && [S4 - Positive] = "TRUE" && [Catalogue] = "NO", "Short-Costing - Procurement"))