title: Power bi returning value based on multiple condition
body: <p>I have the data below</p>
  <pre><code>create table #data (Post_Code varchar(10),  Internal_Code varchar(10))
  insert into #data values
  ('AB10','hb3'),('AB10','hb25'),('AB12','dd1'),('AB15','hb6'),('AB16','aa4'),('AB16','hb7'),
  ('AB16','aa2'),('AB16','ab9'),('AB18','rr6'),('AB18','rr9'),('AB18','hb10'),('AB20','rr15'),
  ('AB20','td2'),('AB21','hb8'),('AB21','cc4'),('AB21','cc4'),('AB24','td5'),('AB9','yy3'),
  ('RM2','CC1'),('RM6','hb6'),('RM7','cc2'),('SA24','rr1'),('SA24','hb5'),('SA24','rr2'),
  ('SA24','cc34'),('SE15','rr9'),('SE15','rr5'),('SE25','rr10'),('SE25','hb11'),('SE25','rr8'),
  ('SE25','rr1'),('LA15','rr2')
  
  select * from #data
  drop table #data
  </code></pre>
  <p>What I want to achieve is if the same post code area have “hb” or “rr” in the same post code I want to return 1 else 0
  The “hb” or “rr” internal_code  must be in the same post_code if they in different post code. It should be 0</p>
  <p>I wrote this DAX</p>
  <pre><code>Result = IF(left(Data[Internal_Code],2)=&quot;hb&quot; || left(Data[Internal_Code],2)=&quot;rr&quot;,1,0)
  </code></pre>
  <p>it is not returning the correct result</p>
  <p>current output</p>
  <p><a href="https://i.stack.imgur.com/9TKns.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9TKns.png" alt="enter image description here" /></a></p>
  <p>expected output</p>
  <p><a href="https://i.stack.imgur.com/CYlK0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CYlK0.png" alt="enter image description here" /></a></p>