Forum Discussion
Anonymous
6 years agoNot applicable
Mulitple Conditions (at row level)
Hello - I have a situation where we have Orders that have different codes. Sometimes just one code. Sometimes multiple. I would like to define a column that looks at each row, evaluating...
Anonymous
6 years agoNot applicable
I think that the formula who I showed you is correct for what you want to do, so you should try to solve the issue with that formula and you'll win 🙂
Single or Multiple Codes = IF(CALCULATE(COUNTROWS(Flu_RMAs), FILTER(Flu_RMAs, Flu_RMAs[RMA Order #] = EARLIER(Flu_RMAs[RMA Order #])), FILTER(Flu_RMAs, Flu_RMAs[Hdr Prob Code] <> EARLIER(Flu_RMAs[Hdr Prob Code]))) > 1, "Multiple", "Single")
ps. Check if you have to use ";" delimiters instead of "," in the queries. It's strange that you receive an error, I think the DAX expression is correct
Anonymous
6 years agoNot applicable
Anonymous - Hi Ricky - Here is how the results of your formula look. For example, RMA-004630 has two Problem Codes associated with it. It should be defined as an order with "Multiple" problem codes, but it is coming up as "Single".
Likewise, some Orders that only have one problem code are coming up as "Multiple".
- Anonymous6 years agoNot applicable
Hi, let's try the same formula but with ">=" instead of ">".
So:
Single or Multiple Codes = IF(CALCULATE(COUNTROWS(Flu_RMAs), FILTER(Flu_RMAs, Flu_RMAs[RMA Order #] = EARLIER(Flu_RMAs[RMA Order #])), FILTER(Flu_RMAs, Flu_RMAs[Hdr Prob Code] <> EARLIER(Flu_RMAs[Hdr Prob Code]))) >= 1, "Multiple", "Single")