Forum Discussion

lsustaita's avatar
lsustaita
New Member
4 years ago
Solved

power query formula needed

 am trying to find matches on multiple rows and then concatonate to only see one record returned when all criteria is the same using 1 table.
1st I have 3 columns, the 1st column is a name, the 2nd and 3d columns are what I need to see if they match on several rows.
2nd. I then need to see how to compare the results are on all locations.
3rd. If the name and 2nd and 3rd columns match and are on all locations, I only want 1 record returned.

Or
If I have to do in 2 queries
1. what is best way to find maches for Name, Data 1 and Data 2 columns on multiple rows
2. How to then complare 1st results to Location

Example:
Column 1 = Location
Column 2 - name
Column 3 & Collumn 4 data is either 0 or 1
In my example for Name 3 I only want to see 1 record since everything matches

 
LocationNameData 1Data 2
Loc 1Name 110
Loc 2Name 110
Loc 3Name 100
Loc 4Name 100
Loc 5Name 110
Loc 6Name 111
Loc 1Name 210
Loc 2Name 210
Loc 3Name 200
Loc 4Name 200
Loc 5Name 210
Loc 6Name 211
Loc 1Name 311
Loc 2Name 311
Loc 3Name 311
Loc 4Name 311
Loc 5Name 311
Loc 6Name 311
  • Hi, lsustaita 

     

    You can try the following methods.

    Judgment = IF([Data 1]=[Data 2],1,0)

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

3 Replies

  • Your criteria for Data1 and Data2 are unclear. Please explain the logic again.

    • lsustaita's avatar
      lsustaita
      New Member

      Data 1 and Data 2 columns are results for Name column.  Data 1 and Data 2 columns will either have 1 or 0.

      There may be up to 15 rows for the same data in the Name column.  The Data 1 and Data 2 columns for the 15 rows may be the same or have different values.  If Data 1 and Data 2 are the same for a number of rows I want to know if they match for the value in the Name column.

      Example:

      NameData 1Data 2
      Name 110
      Name 110
      Name 100
      Name 100
      Name 110
      Name 111
      Name 111
      Name 111
      Name 111
      Name 101
      Name 210
      Name 210
      Name 200
      Name 200
      Name 210
      Name 211
      Name 311
      Name 311
      Name 311
      Name 311
      Name 311
      Name 311
      Name 311
      Name 311
      Name 311
      Name 311
      • v-zhangti's avatar
        v-zhangti
        Icon for Community Support rankCommunity Support

        Hi, lsustaita 

         

        You can try the following methods.

        Judgment = IF([Data 1]=[Data 2],1,0)

        Is this the result you expect?

         

        Best Regards,

        Community Support Team _Charlotte

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.