title: Nested IIF/SWITCH in Report Builder: Error BC30201 Expression Expected
body: <p>I'm doing some Background Colour formatting in Report Builder 3, but I'm having difficulty with this expression. Is it too complicated for the report to run, or am I missing something?</p>
  
  <p>Pseudo Code - If Marks is Null (True), Background Colour is White, else if Coursecode is L1 English (number), Format Grades (Switch 1) else format grades (Switch 2).</p>
  
  <pre><code>=IIF(IsNothing(Fields!Marks.Value), 
      "White",
      IIF(Fields!CourseCode.Value = '50089109',
          SWITCH(
              Fields!Marks.Value &gt; 57, "YellowGreen",
              Fields!Marks.Value &gt;= 48 AND Fields!Marks.Value &lt;= 57 , "Orange",
              Fields!Marks.Value &lt; 48, "Firebrick"
          )
          ,
          SWITCH(
              Fields!Marks.Value &gt; 61, "YellowGreen",
              Fields!Marks.Value &gt;= 52 AND Fields!Marks.Value &lt;= 61 , "Orange",
              Fields!Marks.Value &lt; 52, "Firebrick"
          )
      )
  )
  </code></pre>
  
  <p>This was my other approach for the same problem - starting by evaluating if the course code is true, then applying formatting based on that:</p>
  
  <pre><code>=IIF(Fields!CourseCode.Value = '50089109',
      IIF(IsNothing(Fields!Marks.Value), "White",
      SWITCH(
          Fields!Marks.Value &gt; 57, "YellowGreen",
          Fields!Marks.Value &gt;= 48 AND Fields!Marks.Value &lt;= 57 , "Orange",
          Fields!Marks.Value &lt; 48, "Firebrick"
          )
      ),
      IIF(IsNothing(Fields!Marks.Value), "White", 
      SWITCH(
          Fields!Marks.Value &gt; 61, "YellowGreen",
          Fields!Marks.Value &gt;= 52 AND Fields!Marks.Value &lt;= 61 , "Orange",
          Fields!Marks.Value &lt; 52, "Firebrick"
          )
      )
  )
  </code></pre>