0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

DAX IF代替SWITCH

Posted at

DAX好像没有SWITCH,因此需要用if else赋予不同条件的方式来模拟SWITCH

if [条件列1] = "条件1" or [条件列1] = "条件2" or [条件列1] = "条件3" then "值1" 
else if [条件列1] = "条件4" or [条件列1] = "条件5" or Text.Contains([条件列1],"包含的条件") then "值2" 
else if [条件列1] = "条件6" or [条件列1] = "条件7" or [条件列1] = "条件8" or [条件列1] = "条件9" then "值3" 
else ""
  • Text.Contains()有些像LIKE,用于判断字符串中是否存在某些值的函数
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?