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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
craig811
Helper III
Helper III

Copy/import the whole row from one sheet to another, when text is populated in column

Hi ,

 

Currently I am using a Macro to import the whole row from sheet1 to sheet2 if there is text in column called 'Adjustment' in sheet1.

 

Instead of using a Marco could I use Power Query to do this instead?

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@craig811 

See example:

Shee1

V-pazhen-msft_2-1606801245439.png

Shee2

V-pazhen-msft_0-1606801122749.png
You can filter the sheet 1 to only show a single row, and then append to sheet 2. The example filters the column2 to only show column2 ="z", then append to sheet 2

V-pazhen-msft_1-1606801220918.png

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlbSUaoAYhOlWB0EzxTOqwJiQ6XYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", Int64.Type}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([Column2] = "z")),
    #"Appended Query" = Table.Combine({#"Filtered Rows", Table})
in
    #"Appended Query"

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@craig811 

See example:

Shee1

V-pazhen-msft_2-1606801245439.png

Shee2

V-pazhen-msft_0-1606801122749.png
You can filter the sheet 1 to only show a single row, and then append to sheet 2. The example filters the column2 to only show column2 ="z", then append to sheet 2

V-pazhen-msft_1-1606801220918.png

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlbSUaoAYhOlWB0EzxTOqwJiQ6XYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", Int64.Type}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([Column2] = "z")),
    #"Appended Query" = Table.Combine({#"Filtered Rows", Table})
in
    #"Appended Query"

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

Anonymous
Not applicable

Yes. Just select your sheet 1, then select "From Table".

Once you are in the Query Editor, make a reference query from sheet 1. 

just filter your column by selecting just "Adjustments".  The formula will be:

Table.SelectRows(Sheet1, each List.Contains({"Adjustments"}, [ColumnName]))

--Nate

AlB
Community Champion
Community Champion

Hi @craig811 

Can you share some sample data and explain with an example based on that data, what you need?

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors