Struggling with Basic relationship joins

malraff

New Member
hi

i have 2 really simple data models

data set 1

Code
1
2
3

data set 2

TopLevel desc
1 apple
2 banana
3 Carrot


i join the 2 table with a relationship Code = Toplevel, i have no duplicates

but when i use a pivot table to show the data i get

Code Desc
1 apple
banana
Carrot
2 apple
Banana
Carrot


im obviously missing something obvious to a trained eye?

any ideas?

mal
 

Matt Allington

MrExcel MVP
You only have 1 data model but 2 tables.

A pivot table is a tool to aggregate date, not a query tool. If you want to use a pivot table, you need a measure too. You could simply drag desc to values as well as rows
 

malraff

New Member
You only have 1 data model but 2 tables.

A pivot table is a tool to aggregate date, not a query tool. If you want to use a pivot table, you need a measure too. You could simply drag desc to values as well as rows
hi Matt, thanks for reply
i know i am am trying to use power pivot as a db, which would be nice for me in this instance
desc is a text field (description), if i put it in as a value then it wants to count/sum etc the field? where as i just want the text shown

mal
 

Matt Allington

MrExcel MVP
What version of Excel do you have? If you have Excel 2016, you can write this measure.

=concatonatex(values(table2[Desc]),table2[desc],", ")

if it is 2010/13 you can write this measure

=if(hasonevalue(values(table2[Desc])),values(table2[Desc]),"Multiple Results")
 

Some videos you may like

This Week's Hot Topics

  • Get External Data (long shot question!)
    This is likely a long shot but I am wondering if it is at all possible for Excel to somehow 'change' the contents of a URL that is being linked to...
  • Importing multiple excel files into one spreadsheet
    Hi, I'm trying to import multiple excel files (with the same format into a single spreadsheet) so that each day's file is listed underneath the...
  • Cell Formatting
    Good Morning, I need to format a few different cells in the following manners: A1 has to always add a colon (:) after whatever is typed in by a...
  • How to copy multiple rows using If
    Hi all, I'm very new to VBA and have written this simple code to copy certain cells if a certain cell within that row contains any data. I need...
  • Workbook_Change stopped working !
    I am working on an app to speed up & automate processing of Credit Cards statements. After data is input from a CSV file, it is presented to the...
  • VBA If statement
    Dear All, I have two dates, where I'd like a message box to pop, if the dates are between this criteria. [CODE] sDate1 = #10/1/2019#...
Top