cancel
Showing results for 
Search instead for 
Did you mean: 
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.

View solution in original post

That is it! Thank you very much!

amitchandak
Super User IV
Super User IV

@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/



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

@amitchandak 

 

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

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Urdu Hindi D365 Bootcamp 768x460.png

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors