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.

Reply
uif19085
Helper III
Helper III

Try using Switch but got error: A table multiple values was supplied where a ...

Hello, im trying making a column using Switch function, got this error:  "A table of multiple values was supplied where a single value was expected" and i don't know how to resolve it. Does anyone has any idea what can i do? 
This is the function:

Severity =
SWITCH(TRUE(),
[SIL] <> {"QM","#TBD#"}, "ASIL",
 IF(ISBLANK([SIL]),TRUE(),FALSE()) && [Test_Severity] in {"top"},"top",
 IF(ISBLANK([SIL]),TRUE(),FALSE()) && [Test_Severity] in {"high"},"high",
 IF(ISBLANK([SIL]),TRUE(),FALSE()) && [Test_Severity] in {"medium"},"medium",
 IF(ISBLANK([SIL]),TRUE(),FALSE()) && [Test_Severity] in {"low"},"low",
 IF(ISBLANK([SIL]),TRUE(),FALSE()) && IF(ISBLANK([Test_Severity]),TRUE(),FALSE()),"Not Assigned")

Severity:

  • ASIL : ASIL rated, i.e. neither 'QM' nor '#TBD#'
  • top : not ASIL rated and test severity 'top'
  • high : not ASIL rated and test severity 'high'
  • medium : not ASIL rated and test severity 'medium'
  • low : not ASIL rated and test severity 'low'
  • Not Assigned : not ASIL rated and test severity not specified
2 ACCEPTED SOLUTIONS
v-zhangti
Community Support
Community Support

Hi, @uif19085 

 

You can try the following methods.

Severity = 
SWITCH(TRUE(),
NOT([SIL]) in {"QM","#TBD#"}, "ASIL",
[SIL]<>BLANK() && [Test_Severity] = "top","top",
[SIL]<>BLANK() && [Test_Severity] = "high","high",
[SIL]<>BLANK() && [Test_Severity] = "medium","medium",
[SIL]<>BLANK() && [Test_Severity] = "low","low",
[SIL]<>BLANK() && [Test_Severity]<>BLANK(),"Not Assigned")

vzhangti_0-1675316383445.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Yes, it works, but had to replace every "<>" with "=" 

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @uif19085 

 

You can try the following methods.

Severity = 
SWITCH(TRUE(),
NOT([SIL]) in {"QM","#TBD#"}, "ASIL",
[SIL]<>BLANK() && [Test_Severity] = "top","top",
[SIL]<>BLANK() && [Test_Severity] = "high","high",
[SIL]<>BLANK() && [Test_Severity] = "medium","medium",
[SIL]<>BLANK() && [Test_Severity] = "low","low",
[SIL]<>BLANK() && [Test_Severity]<>BLANK(),"Not Assigned")

vzhangti_0-1675316383445.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Yes, it works, but had to replace every "<>" with "=" 

FreemanZ
Super User
Super User

hi @uif19085 

try like:

SWITCH(
TRUE(),
NOT [SIL] IN {"QM","#TBD#"}, "ASIL",
[Test_Severity] = "top", "top",
[Test_Severity] = "high", "high",
[Test_Severity] = "medium", "medium",
[Test_Severity] = "low", "low",
"Not Assigned"
)

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.