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"
)

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

Not link spamming! If I posted a link in reply it is because I did assume you know how to search the web but thought it was the fastest way to fix your issue.

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"
)

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

Not link spamming! If I posted a link in reply it is because I did assume you know how to search the web but thought it was the fastest way to fix your issue.

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

Highlighted
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
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Don't miss the Power BI Dev Camp this week!

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

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