+ Reply to Thread
Results 1 to 9 of 9

Power Pivot is not detecting relationship

  1. #1
    Forum Contributor
    Join Date
    04-09-2013
    Location
    City, World
    MS-Off Ver
    Office 365
    Posts
    248

    Power Pivot is not detecting relationship

    Hi
    I have 3 simple files and I created relationships but when I upload it to Pivot table then to create a report that shows Salary by Dept, I get error message saying No relationship detected. Please see screen shots and files attached. I would appreciate any help. Thank you so much.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,883

    Re: Power Pivot is not detecting relationship

    There is no common field in pp3 that links to either pp1 or pp2. How did you envision this would work?
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    04-09-2013
    Location
    City, World
    MS-Off Ver
    Office 365
    Posts
    248

    Re: Power Pivot is not detecting relationship

    Thank you Alan for your help and reply. PP1 file has Name columns and PP2 file has Name column too, So I linked them using Name Column. Then PP2 and PP3 files both have ID column so I liked them using ID columns. So this what I was thinking, PP1 and PP2 are linked via Name Column and PP2 and PP3 linked via ID column then all most be linked now, am I wrong? but also lets forget about PP3 file, I liked PP1 and PP2 using Name column, should not that be enough to get the Salary from the PP2, I only used in my Pivot table Dept column (from PP1) and Salary column from PP2. Why even this one does not work. Thank you once again,

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Power Pivot is not detecting relationship

    Hi,

    The order of the tables within the defined relationship matters. Perhaps you mistakenly entered the table from pp1 as the 'Table' and that from pp2 as the 'Related Table'? It should be the contrary.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Forum Contributor
    Join Date
    04-09-2013
    Location
    City, World
    MS-Off Ver
    Office 365
    Posts
    248

    Re: Power Pivot is not detecting relationship

    Thank you very much for your reply. I went back and renamed each table, from PP1.xlsx (tablename = Names), from PP2.xlsx (tablename = Salary), from PP3.xlsx (tablename = StartDate) and I created relationships

    1) PP1.xlsx and PP2.xlsx (Common column is Name)
    2) PP2.xlsx and PP3.xlsz (Common column is ID)

    I am attached the main file (all.xlsx) that has the pivot table. I do not know what wrong I am doing? Thank you very much
    Attached Files Attached Files

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,883

    Re: Power Pivot is not detecting relationship

    The relationship that you have declared is not valid. Each only is a record identifier. In the third table, PP3, you need a foreign key that links to the individual. It is missing. You are linking non relatable data and that is why you are not getting what you need.

    https://www.datensen.com/blog/data-m...s-foreign-key/

    https://www.guru99.com/difference-be...reign-key.html

  7. #7
    Forum Contributor
    Join Date
    04-09-2013
    Location
    City, World
    MS-Off Ver
    Office 365
    Posts
    248

    Re: Power Pivot is not detecting relationship

    I changed the order and it is working now. I first selected the Salary table from PP2.xlsx and then the Names table from PP1.xlsx and that creates different "1 to Many" relationship. Please see attached screenshot. Now my question, how can I know which table I should start? and what does 1 to Many means here? Is it one Name to Many Salaries OR one Salary to many Names? Thank you very muchSNAG-0210.jpg

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,883

    Re: Power Pivot is not detecting relationship

    Picture tells me nothing. Attach your updated sample file with your new relationships for review. I still believe that you are missing a foreign key as the ID in the third table does not relate to any data in the first or second table.

  9. #9
    Forum Contributor
    Join Date
    10-14-2020
    Location
    Shanghai
    MS-Off Ver
    O365
    Posts
    156

    Re: Power Pivot is not detecting relationship

    HI
    You have fact tables (with items you want to slice the data like department, period, names,..) and data table (with salary, ...)

    1 to many means you have a unique list of ID (one for each Name) in your name list. This ID could get a salary every month in your salary table, therefore repeatly showing up every month in the salary table.
    Your tables are not in normal form. e.g. salary table contain the age, the phone number is in the date table.
    For small DB no issues I guess, but thats not the normalization you should use building a DB.

    Looking at your data you only have facts in my opinion. Each table showing some details for one person. In this case you dont need to split the tables, just combine them into one and you are done.

    So, depending if this is the final version of your Files, just join them and its fine. If this is a start for a bigger project, follow the normalization rules and build the modell accordingly

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Power Pivot doesn´t create relationship
    By bacosta99 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 03-27-2021, 02:26 PM
  2. Replies: 1
    Last Post: 07-21-2020, 07:51 PM
  3. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM
  4. Power pivot relationship for date not working
    By AliAB in forum Excel Charting & Pivots
    Replies: 10
    Last Post: 07-22-2017, 05:07 PM
  5. Replies: 0
    Last Post: 02-16-2016, 05:34 AM
  6. Replies: 0
    Last Post: 11-17-2015, 03:12 PM
  7. Unable to create meaningful relationship in Power Pivot
    By Melvinrobb in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-08-2014, 10:28 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1