cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
nickvanmaele
Advocate II
Advocate II

Create Table from a number of lists that act as columns

Hi,

This forum post explains how to create a table from a list and specify the column name;

and this useful blog by @Rickmaurinus explains how to create tables based on adding rows. 

 

However, I am looking to create a table by glueing columns together where each column receives its value from a given list. 

Example, say that I have two lists of 5 elements each, 

  • listA = {"A" .. "E"}
  • listB = {1 .. 5}

By using Power Query functions and the above lists as input, how can I obtain the following table? 

 

ID1ID2
A1
B2
C3
D4
E5

 

I have tried variations on the following: 

Source = Table.Combine(
Table.FromList(listA,Splitter.SplitByNothing(),{"ID1"}),
Table.FromList(listB,Splitter.SplitByNothing(),{"ID2"})

)

 

However, Table.Combine( ) works only by adding rows together, so the above throws an error. 

No doubt that there is an easy and elegant way forward, but I can't seem to find it. 

 

 

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

Source=Table.FromColumns({ListA,ListB},{"ID1","ID2"})

View solution in original post

2 REPLIES 2
nickvanmaele
Advocate II
Advocate II

Thank you. Elegant and simple.

wdx223_Daniel
Super User
Super User

Source=Table.FromColumns({ListA,ListB},{"ID1","ID2"})

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors