Forum Discussion

ddcjoee's avatar
ddcjoee
Frequent Visitor
3 years ago

Merge query returns no matching values when there are matching ID columns

I am working with some tables from Salesforce, and it requires merging queries to relate different objects. I was able to create a Parent Case / Child Case relationship by merging queries successfully, but I am running into issues with another table named Child Case Data Tracker. It has a column ParentCaseId, whcih is an exact match to the previously mentioned Parent Parent Case record. My plan is to match them, then expand / sum a column in there to get a value of work completed to the Parent Case.

 

The issue however, is that for some reason Power BI won't make the connection when I do a merge query. I know there has to be something I am doing wrong because I can visually match the IDs 100%. I can paste the ID into a Salesforce URL and load the parent case, conforming it is indeed the correct ID to use.

 

So far, I have tried doing a trim / clean of both columns from both tables, playing with the merge type, deleting and recreatng the query, and nothing seems to fix it. It is pulling null values for every single record in the original able, even rows I confirmed have a matching ID in the other table.

 

Has anyone experienced something like this before? I am completely stumped on how to get Power BI to recognize this relationship.

2 Replies

  • vanessafvg's avatar
    vanessafvg
    Icon for Community Champion rankCommunity Champion

    are the id's numbers or text? is it possible to share  an example of some of the data that you trying to match?

    • ddcjoee's avatar
      ddcjoee
      Frequent Visitor

      Thank you for the reply! I actually figured it out when I was gathering some sample data for you to reivew.

      It looks like Salesforce was appending a few extra digits to the Parent Case Table ID, that are not always present in the Data Tracker table. 

      5008a000027GPig
      5008a000027GPigAAG

      5008a00001uVEPw

       

      It seems like if I delete the 3 extra digits (15 digit ones work and 18 digit ones don't), I can get a result, so I am thinking, if I do a custom column to remove the last three digits but only if the character length = 18.