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 Experts
I have the following if formula which works upto a certan point...
TWC = IF(Apple[SourceAmt] =1 , "TWC",
IF(AND(Apple[SourceAmt] =1, Apple[trust] > 1000000) , "VB3",
IF(AND(Apple[SourceAmt] =1, Apple[trust] > 100000 && Apple[Trust] < 1000000), "VB2A",
IF(AND(Apple[SourceAmt] =1, Apple[trust] > 25000 && Apple[Trust] < 100000), "VB3A", "VB1")))),
i want to add the following step when Apple[SourceAmt] = 0
IF(AND(Apple[SourceAmt] =0, orange[trust] > 1000000) , "VB4",
IF(AND(Apple[SourceAmt] =0, orange[trust] > 100000 && orange[Trust] < 1000000), "VB5A",
IF(AND(Apple[SourceAmt] =0, orange[trust] > 25000 && orange[Trust] < 100000), "VB6A", "VB1A")))),
Solved! Go to Solution.
Hi @Anonymous ,
Since you are referencing columns from two different tables, it is recommended taht you use measures and use SWITCH function.
Please try following DAX:
Measure = SWITCH(
TRUE(),
MAX(Apple[SourceAmt]) =1 && MAX(Apple[trust]) > 1000000, "VB3",
MAX(Apple[SourceAmt]) =1 && MAX(Apple[trust]) > 100000 && MAX(Apple[trust]) < 1000000, "VB2A",
MAX(Apple[SourceAmt]) =1 && MAX(Apple[trust]) > 25000 && MAX(Apple[Trust]) < 100000, "VB3A",
MAX(Apple[SourceAmt]) =0 && MAX(orange[trust]) > 1000000 , "VB4",
MAX(Apple[SourceAmt]) =0 && MAX(orange[trust]) > 100000 && MAX(orange[Trust]) < 1000000, "VB5A",
MAX(Apple[SourceAmt]) =0 && MAX(orange[trust]) > 25000 && MAX(orange[Trust]) < 100000, "VB6A")
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Has your problem been solved? If solved, please consider Accept it as the solution to help the other members find it more quickly.
Best regards,
Yadong Fang
Hi @Anonymous ,
Since you are referencing columns from two different tables, it is recommended taht you use measures and use SWITCH function.
Please try following DAX:
Measure = SWITCH(
TRUE(),
MAX(Apple[SourceAmt]) =1 && MAX(Apple[trust]) > 1000000, "VB3",
MAX(Apple[SourceAmt]) =1 && MAX(Apple[trust]) > 100000 && MAX(Apple[trust]) < 1000000, "VB2A",
MAX(Apple[SourceAmt]) =1 && MAX(Apple[trust]) > 25000 && MAX(Apple[Trust]) < 100000, "VB3A",
MAX(Apple[SourceAmt]) =0 && MAX(orange[trust]) > 1000000 , "VB4",
MAX(Apple[SourceAmt]) =0 && MAX(orange[trust]) > 100000 && MAX(orange[Trust]) < 1000000, "VB5A",
MAX(Apple[SourceAmt]) =0 && MAX(orange[trust]) > 25000 && MAX(orange[Trust]) < 100000, "VB6A")
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |