如果在切片器中选择了所有用户,则卡应显示“所有用户”,否则用逗号分隔用户
我在下面创建了度量,但是当我选择多个用户时,该卡将显示“所有用户”,而不是用逗号隔开
User = VAR UserName1 = SELECTEDVALUE(dim_User[Name_FirstLast])
RETURN
"Actions for " & IF(ISBLANK(UserName1), "All Users",
CONCATENATEX ( VALUES(dim_User[Name_FirstLast]), UserName1, "," ))
应该是这样的:
答案 0 :(得分:2)
如果您有多项选择,SELECTEDVALUE
函数将返回空白。
代替定义变量,请尝试如下操作:
User = "Actions for " &
IF(
ISFILTERED( dim_User[Name_FirstLast] ),
CONCATENATEX ( VALUES(dim_User[Name_FirstLast]), dim_User[Name_FirstLast], "," ),
"All Users"
)