power bi 之星座分析
程序员文章站
2024-02-24 13:27:34
...
第一步分析出月日:
月日 = IFERROR( VALUE(FORMAT([birthday],"MMdd")),0)
获取星座:
星座 = SWITCH(TRUE(),
[月日] >= 120 && [月日]<=218 ,"水瓶座",
[月日] >= 219 && [月日]<=320 ,"双鱼座",
[月日] >= 321 && [月日]<=419 ,"白羊座",
[月日] >= 420 && [月日]<=520 ,"金牛座",
[月日] >= 521 && [月日]<=621 ,"双子座",
[月日] >= 622 && [月日]<=722 ,"巨蟹座",
[月日] >= 723 && [月日]<=822 ,"狮子座",
[月日] >= 823 && [月日]<=922 ,"处女座",
[月日] >= 923 && [月日]<=1023 ,"天秤座",
[月日] >= 1024 && [月日]<=1122 ,"天蝎座",
[月日] >= 1123 && [月日]<=1221 ,"射手座",
[月日] >= 1224 ,"摩羯座",
[月日] >=11 && [月日]<=119,"摩羯座",
"未知")