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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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