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
Treasured2005
Regular Visitor

Switch Statement Not Working

None of my other columns required a switch function.  The if statements are working on their own, but not when put together.  Any help would be appreciated.
 
Treasured2005_0-1659709547505.png

 

Days for IV Approval =
SWITCH (
IF(ISBLANK([Ready for Treasury Approval]) && ISBLANK([Ready for Credit Approval]) && ISBLANK([Ready for Tax Approval]) && ISBLANK([Ready for Category Manager Approval]) && NOT(ISBLANK([Submitted to Workflow])) && NOT(ISBLANK([Ready for Independent Validation Approval])),
    [Ready for Independent Validation Approval] - [Submitted to Workflow]),
IF(ISBLANK([Ready for Treasury Approval]) && ISBLANK([Ready for Credit Approval]) && ISBLANK([Ready for Tax Approval]) && NOT(ISBLANK([Ready for Category Manager Approval])) && NOT(ISBLANK([Ready for Independent Validation Approval])) && NOT(ISBLANK([Submitted to Workflow])),
    [Ready for Independent Validation Approval] - [Ready for Category Manager Approval]),
IF(ISBLANK([Ready for Treasury Approval]) && ISBLANK([Ready for Credit Approval]) && NOT(ISBLANK([Ready for Tax Approval])) && NOT(ISBLANK([Ready for Independent Validation Approval])) && NOT(ISBLANK([Submitted to Workflow])),
    [Ready for Independent Validation Approval] - [Ready for Tax Approval]),
IF(ISBLANK([Ready for Treasury Approval]) && NOT(ISBLANK([Ready for Credit Approval])) && NOT(ISBLANK([Ready for Independent Validation Approval])) && NOT(ISBLANK([Submitted to Workflow])),
    [Ready for Independent Validation Approval] - [Ready for Credit Approval]),
IF(NOT(ISBLANK([Ready for Treasury Approval])) && NOT(ISBLANK([Ready for Independent Validation Approval])) && NOT(ISBLANK([Submitted to Workflow])),
    [Ready for Independent Validation Approval] - [Ready for Treasury Approval])
)
1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You don't need the IF statements within SWITCH, try

Days for IV Approval =
SWITCH (
    TRUE (),
    ISBLANK ( [Ready for Treasury Approval] )
        && ISBLANK ( [Ready for Credit Approval] )
        && ISBLANK ( [Ready for Tax Approval] )
        && ISBLANK ( [Ready for Category Manager Approval] )
        && NOT ( ISBLANK ( [Submitted to Workflow] ) )
            && NOT ( ISBLANK ( [Ready for Independent Validation Approval] ) ), [Ready for Independent Validation Approval] - [Submitted to Workflow],
    ISBLANK ( [Ready for Treasury Approval] )
        && ISBLANK ( [Ready for Credit Approval] )
        && ISBLANK ( [Ready for Tax Approval] )
        && NOT ( ISBLANK ( [Ready for Category Manager Approval] ) )
            && NOT ( ISBLANK ( [Ready for Independent Validation Approval] ) )
                && NOT ( ISBLANK ( [Submitted to Workflow] ) ),
        [Ready for Independent Validation Approval] - [Ready for Category Manager Approval],
    ISBLANK ( [Ready for Treasury Approval] )
        && ISBLANK ( [Ready for Credit Approval] )
        && NOT ( ISBLANK ( [Ready for Tax Approval] ) )
            && NOT ( ISBLANK ( [Ready for Independent Validation Approval] ) )
                && NOT ( ISBLANK ( [Submitted to Workflow] ) ), [Ready for Independent Validation Approval] - [Ready for Tax Approval],
    ISBLANK ( [Ready for Treasury Approval] )
        && NOT ( ISBLANK ( [Ready for Credit Approval] ) )
            && NOT ( ISBLANK ( [Ready for Independent Validation Approval] ) )
                && NOT ( ISBLANK ( [Submitted to Workflow] ) ), [Ready for Independent Validation Approval] - [Ready for Credit Approval],
    NOT ( ISBLANK ( [Ready for Treasury Approval] ) )
        && NOT ( ISBLANK ( [Ready for Independent Validation Approval] ) )
            && NOT ( ISBLANK ( [Submitted to Workflow] ) ), [Ready for Independent Validation Approval] - [Ready for Treasury Approval]
)

View solution in original post

2 REPLIES 2
Treasured2005
Regular Visitor

Thank you!

 

johnt75
Super User
Super User

You don't need the IF statements within SWITCH, try

Days for IV Approval =
SWITCH (
    TRUE (),
    ISBLANK ( [Ready for Treasury Approval] )
        && ISBLANK ( [Ready for Credit Approval] )
        && ISBLANK ( [Ready for Tax Approval] )
        && ISBLANK ( [Ready for Category Manager Approval] )
        && NOT ( ISBLANK ( [Submitted to Workflow] ) )
            && NOT ( ISBLANK ( [Ready for Independent Validation Approval] ) ), [Ready for Independent Validation Approval] - [Submitted to Workflow],
    ISBLANK ( [Ready for Treasury Approval] )
        && ISBLANK ( [Ready for Credit Approval] )
        && ISBLANK ( [Ready for Tax Approval] )
        && NOT ( ISBLANK ( [Ready for Category Manager Approval] ) )
            && NOT ( ISBLANK ( [Ready for Independent Validation Approval] ) )
                && NOT ( ISBLANK ( [Submitted to Workflow] ) ),
        [Ready for Independent Validation Approval] - [Ready for Category Manager Approval],
    ISBLANK ( [Ready for Treasury Approval] )
        && ISBLANK ( [Ready for Credit Approval] )
        && NOT ( ISBLANK ( [Ready for Tax Approval] ) )
            && NOT ( ISBLANK ( [Ready for Independent Validation Approval] ) )
                && NOT ( ISBLANK ( [Submitted to Workflow] ) ), [Ready for Independent Validation Approval] - [Ready for Tax Approval],
    ISBLANK ( [Ready for Treasury Approval] )
        && NOT ( ISBLANK ( [Ready for Credit Approval] ) )
            && NOT ( ISBLANK ( [Ready for Independent Validation Approval] ) )
                && NOT ( ISBLANK ( [Submitted to Workflow] ) ), [Ready for Independent Validation Approval] - [Ready for Credit Approval],
    NOT ( ISBLANK ( [Ready for Treasury Approval] ) )
        && NOT ( ISBLANK ( [Ready for Independent Validation Approval] ) )
            && NOT ( ISBLANK ( [Submitted to Workflow] ) ), [Ready for Independent Validation Approval] - [Ready for Treasury Approval]
)

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.