cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Need Help with SWITCH or IF function

Hi!

 

Im trying to create a calculated column to determine the status using 2 columns (initial and final review) as reference.

 

INITIAL REVIEWFINAL REVIEWSTATUS
COMPLETED PENDING FINAL REVIEW
COMPLETEDCOMPLETEDCOMPLETED
  PENDING INITIAL AND FINAL REVIEW

 

I have trouble how to incorporate the non-blanks into DAX.

So far I have come up with:

 

=SWITCH(TRUE(),[INITIAL Review]&&[FINAL REVIEW]=BLANK(),"PENDING INITIAL REVIEW",[INITIAL Review]&&[FINAL REVIEW]=,"COMPLETED",)

 

Many thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IX
Super User IX

Re: Need Help with SWITCH or IF function

@jrpoli2000- Perhaps try this:

 

STATUS = 
SWITCH(
    TRUE(),
    ISBLANK([INITIAL REVIEW]) && ISBLANK([FINAL REVIEW]),
        "PENDING INITIAL AND FINAL REVIEW",
    [INITIAL Review]="COMPLETED" && [FINAL REVIEW]="COMPLETED",
        "COMPLETED",
    "PENDING INITIAL REVIEW"
)

---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
Highlighted
Super User IX
Super User IX

Re: Need Help with SWITCH or IF function

@jrpoli2000- Perhaps try this:

 

STATUS = 
SWITCH(
    TRUE(),
    ISBLANK([INITIAL REVIEW]) && ISBLANK([FINAL REVIEW]),
        "PENDING INITIAL AND FINAL REVIEW",
    [INITIAL Review]="COMPLETED" && [FINAL REVIEW]="COMPLETED",
        "COMPLETED",
    "PENDING INITIAL REVIEW"
)

---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




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

Proud to be a Super User!




View solution in original post

Frequent Visitor

Re: Need Help with SWITCH or IF function

Thanks a lot!!! also used ISTEXT because the entry sometimes for both Initial and Final Review columns will not be always COMPLETED.

 

Thanks again! 

Helpful resources

Announcements

August Community Highlights

Check out a full recap of the month!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors