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
If statement PowerBI多重If';s不';t分割数据_If Statement_Powerbi - Fatal编程技术网

If statement PowerBI多重If';s不';t分割数据

If statement PowerBI多重If';s不';t分割数据,if-statement,powerbi,If Statement,Powerbi,我目前正在寻找在PowerBI上制作一个年龄切片器,但它不起作用。 你能帮我吗? 提前谢谢你! 我的代码: Age Slice.1 = if( 20<VALUE(CONTRACT_BASIS[Age]), "<20", if( 20<=VALUE(CONTRACT_BASIS[Age])<25, "20-25",

我目前正在寻找在PowerBI上制作一个年龄切片器,但它不起作用。 你能帮我吗? 提前谢谢你! 我的代码:

Age Slice.1 = 
    if(
        20<VALUE(CONTRACT_BASIS[Age]),
        "<20",
        if(
            20<=VALUE(CONTRACT_BASIS[Age])<25,
            "20-25",
            if(
                25<=VALUE(CONTRACT_BASIS[Age])<30,
                "25-30",
                if(
                    30<=VALUE(CONTRACT_BASIS[Age])<40,
                    "30-40",
                    if(
                        40<=VALUE(CONTRACT_BASIS[Age])<50,
                        "40-50",
                        if(
                            50<=VALUE(CONTRACT_BASIS[Age]),
                            "50+",
                            "no age displayed"
                            )              
                    )
                )
            )
        )
    )
Age Slice.1=
如果(

20用这个问题解决了它:

Age Slice.1 = 
SWITCH(
    TRUE(),
    CONTRACT_BASIS[Age]<20,"<20",
    20<=CONTRACT_BASIS[Age] && CONTRACT_BASIS[Age]<25,"20-25",
    25<=CONTRACT_BASIS[Age] && CONTRACT_BASIS[Age]<30,"25-30",
    30<=CONTRACT_BASIS[Age] && CONTRACT_BASIS[Age]<40,"30-40",
    40<=CONTRACT_BASIS[Age] && CONTRACT_BASIS[Age]<50,"40-50",
    50<=CONTRACT_BASIS[Age],"50+"
)
Age Slice.1=
开关(
真(),
合同基础[Age]
Age切片。1=
如果(
合同基础[年龄]
Age Slice.1 = 
    if(
        CONTRACT_BASIS[Age]<20,"<20",
        if(
            20<=CONTRACT_BASIS[Age] && CONTRACT_BASIS[Age]<25,"20-25",
            if(
                25<=CONTRACT_BASIS[Age] && CONTRACT_BASIS[Age]<30,"25-30",
                if(
                    30<=CONTRACT_BASIS[Age] && CONTRACT_BASIS[Age]<40,"30-40",
                    if(
                        40<=CONTRACT_BASIS[Age] && CONTRACT_BASIS[Age]<50,"40-50",
                        if(
                            50<=CONTRACT_BASIS[Age],"50+"
                            )              
                    )
                )
            )
        )
    )