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.
I have been utilizing the below IF statement - and it works as expected. However, I now need to add an additional parameter to check for Orders that also now start with a "T".
Drop-Ship/Warehouse Order Filter =
IF(
fSales[CustomerID] = "Amazon" && LEFT(fSales[PO],1) <> "U" ,
"Warehouse Order",
"Drop-Ship Order")
When I add in this additional parameter the formula no longer works. Please help. Below is the formula I have created, and have also tried other ways and I feel as if Im not aware of something.
Drop-Ship/Warehouse Order Filter =
IF(
fSales[CustomerID] = "Amazon" && LEFT(fSales[PO],1) <> "U" || fSales[CustomerID] = "Amazon" && LEFT(fSales[PO],1) <> "T" ,
"Warehouse Order",
"Drop-Ship Order")
Please let me know if there is a better way of doing so. Maybe SWITCH will work better. I'll start futsing around with SWITCH.
Thanks in advance!
Solved! Go to Solution.
@AlexAlberga727 , I can't catch you with what you described in your first post,
... add an additional parameter to check for Orders that also now start with a "T".
You mean NOT starts with "T" either, right?
You might try to author it this way,
Drop-Ship/Warehouse Order Filter =
IF (
fSales[CustomerID] = "Amazon"
&& NOT LEFT ( fSales[PO], 1 ) IN { "U", "T" },
"Warehouse Order",
"Drop-Ship Order"
)
//if fSales[CustomerID] is "Amazon" and fSales[PO] doesn't start with "U" or "T", then "Warehouse Order", else "Drop-Ship Order"
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
@CNENFRNL Thanks for the infomation. However, do you have a solution to the problem I presented, or just throwing out information that im already following.
@AlexAlberga727 , I can't catch you with what you described in your first post,
... add an additional parameter to check for Orders that also now start with a "T".
You mean NOT starts with "T" either, right?
You might try to author it this way,
Drop-Ship/Warehouse Order Filter =
IF (
fSales[CustomerID] = "Amazon"
&& NOT LEFT ( fSales[PO], 1 ) IN { "U", "T" },
"Warehouse Order",
"Drop-Ship Order"
)
//if fSales[CustomerID] is "Amazon" and fSales[PO] doesn't start with "U" or "T", then "Warehouse Order", else "Drop-Ship Order"
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
This works for my needs. Thanks a bunch. Interesting way you have coded this one. I have not used IN in that fashion. I'll add this to my quiver.
Thanks!
@CNENFRNL It seems as if I am following that guidince. <> before ||.
Is this how you're interpreting the rules too?
@AlexAlberga727 , yes, <> (comparison operator) is precedent than || (logical operator).
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hi, @AlexAlberga727 , operators are assigned different precedences; you might want to refer to this table for details and tweak your formula accordingly.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
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 |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
36 | |
33 | |
18 | |
18 |