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.

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.