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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

SWITCH command failing

The SWITCH command is failing when being used with more than 10 levels in DirectQuery.  I sent a frown and received a response, so I'm guessing it's in the ICM, but I'd like to know status since all queries I have using SWITCH commands fail given more than 10 options.

Status: New
Comments
v-qiuyu-msft
Community Support

Hi @ColinE711,

 

Did you create a caluclated column or a measure in DirectQuery mode?

 

Best Regards,
Qiuyun Yu

ColinE711
New Member

It is a calculated column.  I have since tried to change to use more than 10 nested IF statements, and it fails with the same error.  It appears to be that the number of nested cases is capped at 10 for case expressions, which appears to be a limitation introduced by Power BI.  The MSDN example used in the SWITCH documentation shows 13 cases.

 

The error I receive is:

Case expressions may only be nested to level 10.