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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Milan
Frequent Visitor

Prepare data for analyzing

Hello community, 

 

i have issue with preparing data for analyzing combination of them.

 

I have excel/csv table with 1 column and approximately 1500 rows. And would like to make table with two columns. It will be combination of all options. Thats 1500x1500 = 2 250 000 rows.

 

I make simple example with 3 rows, thats mean 9 combinations. 

 

I think so the best way to do that is in Power Query.


Does anybody have any idea how to do that?

 

Thanks for your help and time

 

Milan

 

 

Power Query prepare data.png

2 ACCEPTED SOLUTIONS
m13eam
Resolver II
Resolver II

Hi - yes, that is possible in PowerQuery:

 

  • Load your Excel file containing the 1500 rows into PowerQuery
  • At the end of that query, add a "Custom Column"
  • Enter a formula, referencing the previous step. For example, if the previous step in the query was "Changed Type", you would enter: 

 

 

= #"Changed Type"​

 

 

See my example, where my previous step was "Renamed Columns":m13eam_2-1666349966147.png

  • Expand the new column and you should now have all the combinations in a 2 column table!m13eam_3-1666350196077.png

     

I hope that helps. Let me know if any steps were unclear.

 

If this solved the issue, please mark my post as a solution.

 

Thanks!

View solution in original post

Yep. This is what MS documentation suggests too.

https://learn.microsoft.com/en-us/power-query/cross-join

 

@Milan Just FYI, this type of transformation is called a "cross join" or a "Cartesian product" of a table/list with itself.

View solution in original post

3 REPLIES 3
Milan
Frequent Visitor

Hello, guys. Thanks for your help.

m13eam
Resolver II
Resolver II

Hi - yes, that is possible in PowerQuery:

 

  • Load your Excel file containing the 1500 rows into PowerQuery
  • At the end of that query, add a "Custom Column"
  • Enter a formula, referencing the previous step. For example, if the previous step in the query was "Changed Type", you would enter: 

 

 

= #"Changed Type"​

 

 

See my example, where my previous step was "Renamed Columns":m13eam_2-1666349966147.png

  • Expand the new column and you should now have all the combinations in a 2 column table!m13eam_3-1666350196077.png

     

I hope that helps. Let me know if any steps were unclear.

 

If this solved the issue, please mark my post as a solution.

 

Thanks!

Yep. This is what MS documentation suggests too.

https://learn.microsoft.com/en-us/power-query/cross-join

 

@Milan Just FYI, this type of transformation is called a "cross join" or a "Cartesian product" of a table/list with itself.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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