Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
sblbs
New Member

Building a data table

I am trying to link two spreadsheets in Power BI, creating a data table. I have an index key column to make each row unique, but when I select the two index key options in the Data column to bring them together in Report view, they are in separate columns, so the overall data in still split. How do I get the Index Keys into one column? Thanks

 

sblbs_0-1691074289705.png

 

2 REPLIES 2
kpost
Super User
Super User

Create a new table like this one:

Index_Master =
DISTINCT(UNION(SELECTCOLUMNS('Table_1', "Index Key", 'Table_1'[Index Key]), SELECTCOLUMNS('Table_2', "Index Key", Table_2[Index Key])))

Now create relationships between Index_Master['Index Key'] and the [Index Key] columns in your other two tables.

In the table visual, you will  now be able to add all the values to your table, and also pull in data from the other two tables as needed that is associated with each key.

//Mediocre Power BI Advice, but it's free//
kpost
Super User
Super User

Create a new table like this:

Index_Master = 

 DISTINCT(
                  UNION(
                               SELECTCOLUMNS(
                                                             'Table_1',
                                                              "Index Key",
                                                               'Table_1'['Index Key']
                                                             ),
                               SELECTCOLUMNS(
                                                               'Table_2',
                                                               
"Index Key",
                                                               
Table_2[Index Key]
                                                             
)
                                )
                 )

Then create active 1:1 relationships between this column and the "Index Key" values in both of your tables.  Use Index_Master[Index Key] in your table.


//Mediocre Power BI Advice, but it's free//

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.