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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
bpalavra
Regular Visitor

Create data table from data of one column (Power Query)

Hi guys,

 

I have a single column table that I need to transform into a 2 column table which replicates the rows as shown below:

 

I would be grateful if anyone could help me with this as I need to calculate it in Power Query

 

- I need to transform this:

bpalavra_1-1620204832567.png

 

In this (righ side table)

 

bpalavra_0-1620204798923.png

Thank you!

 

 

1 ACCEPTED SOLUTION
v-angzheng-msft
Community Support
Community Support

Hi, @bpalavra 

 

Add a custom column with the formula below:

=Table.ToColumns(#"Changed Type"){0}

v-angzheng-msft_0-1620381257905.jpeg

Then expand list to new row

v-angzheng-msft_1-1620381257907.jpeg

Sample:

v-angzheng-msft_2-1620381257907.jpeg

v-angzheng-msft_3-1620381257909.jpeg

Result:

v-angzheng-msft_4-1620381257910.jpeg

Please refer to the attachment below for details

 

 

Is this the result you want? Hope this is useful to you

Please feel free to let me know If you have further questions

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-angzheng-msft
Community Support
Community Support

Hi, @bpalavra 

 

Add a custom column with the formula below:

=Table.ToColumns(#"Changed Type"){0}

v-angzheng-msft_0-1620381257905.jpeg

Then expand list to new row

v-angzheng-msft_1-1620381257907.jpeg

Sample:

v-angzheng-msft_2-1620381257907.jpeg

v-angzheng-msft_3-1620381257909.jpeg

Result:

v-angzheng-msft_4-1620381257910.jpeg

Please refer to the attachment below for details

 

 

Is this the result you want? Hope this is useful to you

Please feel free to let me know If you have further questions

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

That is it! Thank you very much!

amitchandak
Super User
Super User

@bpalavra ,

a new table

crossjoin(all(Table[Origin]) , SELECTCOLUMNS(Table, "Destination",Table[Origin]))

 

Try

https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/

@amitchandak 

 

Thank you for your reply, which is very helpful, but I need to do it in Power Query.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.