Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powerbi 将开关用作嵌套的comaprison时发生Dax错误_Powerbi_Dax - Fatal编程技术网

Powerbi 将开关用作嵌套的comaprison时发生Dax错误

Powerbi 将开关用作嵌套的comaprison时发生Dax错误,powerbi,dax,Powerbi,Dax,嗨,我正试图得到一个基于两个度量值的最后一栏,我使用的是Power BI,但我在这方面是新手。这是公式。我收到一个错误“函数开关不支持将true/false类型的值与text类型的值进行比较” 开关( 和((‘Table’[ar]*100)=-100,(‘Table’[ar]*100)=-5,(‘Table’[br]*100)=-100,(‘Table’[br]*100)=-5,(‘Table’[ar]*100)=-100,(‘Table’[br]*100)=-100,(‘Table’[br]*

嗨,我正试图得到一个基于两个度量值的最后一栏,我使用的是Power BI,但我在这方面是新手。这是公式。我收到一个错误“函数开关不支持将true/false类型的值与text类型的值进行比较”

开关(

和((‘Table’[ar]*100)=-100,(‘Table’[ar]*100)=-5,(‘Table’[br]*100)=-100,(‘Table’[br]*100)=-5,(‘Table’[ar]*100)=-100,(‘Table’[br]*100)=-100,(‘Table’[br]*100)您得到了那个错误,因为您在
函数中有一些包含文本的括号放错了。例如,,(‘Table’[br]*100=-100)&(‘Table’[ar]*100=-5)&(‘Table’[br]*100=-100)&(‘Table’[br]*100=-5)&(‘Table’[ar]*100=-100)&(‘Table’[br]*100=-5)&(‘Table’[br]*100=-100)&(‘Table’[br]*100)&(‘Table’[br]*100)&&
SWITCH(
    AND(('Table'[ar]*100)>=-100,('Table'[ar]*100)<=-5),
        SWITCH(
          AND(('Table'[br]*100)>=-5,('Table'[br]*100)<=5),"DROP TO AVG",
          AND(('Table'[br]*100)<=100,('Table'[br]*100)>=5),"DROP TO HIGH",
          AND(('Table'[br]*100)>=-100,('Table'[br]*100)<=-5),"BAD ALERT"),
    AND(('Table'[ar]*100)>=-5,('Table'[ar]*100)<=5),
        SWITCH(
          AND(('Table'[br]*100)<=100,('Table'[br]*100)>=5),"KEEP HIGH",
          AND(('Table'[br]*100)>=-100 ,('Table'[br]*100)<=-5),"KEEP LOW"),
    AND(('Table'[ar]*100)<=100,('Table'[ar]*100)>=5),
        SWITCH(
          AND(('Table'[br]*100)>=-5,('Table'[br]*100)<=5),"INCREASE TO AVG",
          AND(('Table'[br]*100)>=-100,('Table'[br]*100)<=-5),"INCREASE TO LOW",
          AND(('Table'[br]*100)<=100,('Table'[br]*100)>=5),"GOOD ALERT"))
SWITCH(TRUE(),
    ('Table'[ar]*100 >= -100) && ('Table'[ar]*100 <= -5),
    SWITCH(TRUE(),
        ('Table'[br]*100 >=  -5 ) && ('Table'[br]*100 <=  5), "DROP TO AVG",
        ('Table'[br]*100 <=  100) && ('Table'[br]*100 >=  5), "DROP TO HIGH",
        ('Table'[br]*100 >= -100) && ('Table'[br]*100 <= -5), "BAD ALERT"
    ),
    ('Table'[ar]*100 >= -5) && ('Table'[ar]*100 <=5),
    SWITCH(TRUE(),
        ('Table'[br]*100 <=  100) && ('Table'[br]*100 >=  5), "KEEP HIGH",
        ('Table'[br]*100 >= -100) && ('Table'[br]*100 <= -5), "KEEP LOW"
    ),
    ('Table'[ar]*100 <= 100) && ('Table'[ar]*100 >= 5),
    SWITCH(TRUE(),
        ('Table'[br]*100 >=  -5 ) && ('Table'[br]*100 <=  5), "INCREASE TO AVG",
        ('Table'[br]*100 >= -100) && ('Table'[br]*100 <= -5), "INCREASE TO LOW",
        ('Table'[br]*100 <=  100) && ('Table'[br]*100 >=  5), "GOOD ALERT"
    )
)