Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I need help in coding this using DAX. I am getting circular dependency error. What I want is to make a DAX code similar to if then do statement in SAS.
Algorithm:
If 1<=range<=5 then do;
if 0<discount<1 then A
if 1<discount<2 then B
if 2<discount<3 then C
end;
If 6<=range<=10 then do;
if 4<discount<5 then A
if 5<discount<6 then B
if 6<discount<7 then C
end;
else then do;
if 10<discount<11 then A
if 11<discount<12 then B
if 12<discount<13 then C
Solved! Go to Solution.
@Anonymous , Try like
Switch( True(),
[range] <=5 , Switch(True() ,
[discount]<1, "A",
[discount]<2, "B",
[discount]<3, "C") ,
[range] <=10 , Switch(True() ,
[discount]<5, "A",
[discount]<6, "B",
[discount]<7, "C"),
Switch(True() ,
[discount]<11, "A",
[discount]<12, "B",
[discount]<13, "C") )
@Anonymous , Try like
Switch( True(),
[range] <=5 , Switch(True() ,
[discount]<1, "A",
[discount]<2, "B",
[discount]<3, "C") ,
[range] <=10 , Switch(True() ,
[discount]<5, "A",
[discount]<6, "B",
[discount]<7, "C"),
Switch(True() ,
[discount]<11, "A",
[discount]<12, "B",
[discount]<13, "C") )
User | Count |
---|---|
104 | |
86 | |
79 | |
70 | |
70 |
User | Count |
---|---|
112 | |
100 | |
98 | |
72 | |
66 |