cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
viferenc
Helper I
Helper I

Need help mulitple line

Dear All,

 

I would like to ask fo your help.

 

I have in Table 1 a column with the following text.

Column A

Car

Bus

Airplane

Boot

 

In Table 2 I have column with the following text.

Column A

1

2

3

4

...

 

I would like to combine it power query that I have new table with the following way.

 

Column A        Column B

1                          Car

2                          Car

3                          Car

4                          Car

...                         Car

1                         Bus

2                         Bus

3                         Bus

4                         Bus

...                         Bus

1                       Airplane

2                       Airplane

3                       Airplane

4                       Airplane

...                      Airplane

1                      Boot

2                      Boot

3                      Boot

4                      Boot

...                     Boot

 

My goal is to show the text among each other ten times or hundred times with an extra column of the numbers startring always from 1 for each text.

 

Thank you for your help

 

Feri

 

 

 

2 ACCEPTED SOLUTIONS
ChrisMendoza
Super User I
Super User I

Add a Custom Column to Table2 as:

Table.Column(Table1,"Column A")

Expand the List to Rows to this:

image.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlSK1YlWMgKTxmDSBEyaKsXGAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ColumnA = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ColumnA", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Table.Column(Table1,"Column A")),
    #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom")
in
    #"Expanded Custom"





Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



View solution in original post

@viferenc - I would recommend posting your follow-up issue as a new post. It is very likely someone else has a solution or better understanding of what you describe.






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



View solution in original post

3 REPLIES 3
ChrisMendoza
Super User I
Super User I

Add a Custom Column to Table2 as:

Table.Column(Table1,"Column A")

Expand the List to Rows to this:

image.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlSK1YlWMgKTxmDSBEyaKsXGAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ColumnA = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ColumnA", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Table.Column(Table1,"Column A")),
    #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom")
in
    #"Expanded Custom"





Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



View solution in original post

Dear Chris,

 

thank you for your help.

 

I had to modify a little bit, as I had to use more line.

See the formula below: (sorry it is in German)

 

let
Quelle = List.Numbers(1, 1000),
#"In Tabelle konvertiert" = Table.FromList(Quelle, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Hinzugefügte benutzerdefinierte Spalte" = Table.AddColumn(#"In Tabelle konvertiert", "Custom", each Table.Column(Table1,"ColumnA")),
#"Expanded Custom" = Table.ExpandListColumn(#"Hinzugefügte benutzerdefinierte Spalte", "Custom")
in
#"Expanded Custom"

 

The problem is when the query is running, it is loading millions of line although altogether it should be only 92000 lines. (1000*92) 

 

Is there any possibility to reduce the number of loading lines because at the end I have to use instead of 1.000 lines 1.000.000 lines

I calculated to load 92*1.000.000=92.000.000 lines and not billions of lines during the loading process. (I  have 92 different trucks, they run 1.000.000 km and for each km I´m planning to show average fuel consumption to be able to calculate for each transport the fuel consumption)

 

If there is any possibility to help me it would be great.

 

Thank you very much for your help.

 

Feri

@viferenc - I would recommend posting your follow-up issue as a new post. It is very likely someone else has a solution or better understanding of what you describe.






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



View solution in original post

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