Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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") )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
101 | |
78 | |
69 | |
63 |
User | Count |
---|---|
141 | |
106 | |
101 | |
85 | |
72 |