Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi, I have a data as follow. My rule for Company is that if all Customer in the same route is "Z", the returned value is "Food"; otherwise return "Log"
| Route No | Customer | Company (desired result) | 
| 1 | Z | Log | 
| 1 | Z | Log | 
| 1 | O | Log | 
| 1 | Z | Log | 
| 2 | Z | Food | 
| 2 | Z | Food | 
| 2 | Z | Food | 
| 2 | Z | Food | 
| 3 | O | Log | 
| 3 | O | Log | 
| 3 | O | Log | 
| 3 | O | Log | 
Any help would be appreciated.
Solved! Go to Solution.
Perhaps:
Column =
  VAR __Route = [Route No]
  VAR __Table = SELECTCOLUMNS(FILTER('Table',[Route No] = __Route),"__Customer",[Customer])
RETURN
  IF("O" IN __Table,"Log","Z")
Perhaps:
Column =
  VAR __Route = [Route No]
  VAR __Table = SELECTCOLUMNS(FILTER('Table',[Route No] = __Route),"__Customer",[Customer])
RETURN
  IF("O" IN __Table,"Log","Z")
The following should work:
Please try.
IF(AND([Customer]= "Z", [Route No]=2),"Food","Log")
Or
IF [Customer] = "Z" and [Route No] = 2 then "Food" else "Log"
 
 Proud to be a Super User!  |   | 
Thank you for your fast reply.
The problem is that my data has more than a thousand routes. The above is just a sample. I'm sorry for not being clear in the description.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.