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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Conditional Fill Down

I'm looking to perform a fill down based on another column. I'd like to fill down the "Property" column based on the "Invoice #" column. Whenever the invoice number column is duplicated, I'd like to fill down the property column.

 

End result: In the screenshot below, I'd like for "Brazilian" to fill down the next two columns (and no further). 

 

MDD_0-1677613747246.png

 

Thank you so much!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WClIwNNI3NNAFkSZKOkpKsTo4BI0VUhIri2E8QwtjEyNLIM+pKLEqMyczMQ9VGAvPKzFP18gYyHPPSc1TcE1Mz0ktRkhA7IkFAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Invoice#" = _t, Property = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Invoice#", type text}, {"Property", type text}}),
    #"Replaced Value" = Table.ReplaceValue(#"Changed Type","",null,Replacer.ReplaceValue,{"Property"}),
    #"Grouped Rows" = Table.Group(#"Replaced Value", {"Invoice#"}, {{"Count", each List.Min([Property]), type nullable text}, {"Data", each _, type table [#"Invoice#"=nullable text, Property=nullable text]}}),
    #"Expanded Data" = Table.ExpandTableColumn(#"Grouped Rows", "Data", {"Property"}, {"Data.Property"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Data",{"Data.Property"}),
    #"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Count", "Property"}})
in
    #"Renamed Columns"

 

Then the result is as follows.

vtangjiemsft_1-1677650723663.png

Best Regards,

Neeko Tang

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

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

 

See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WClIwNNI3NNAFkSZKOkpKsTo4BI0VUhIri2E8QwtjEyNLIM+pKLEqMyczMQ9VGAvPKzFP18gYyHPPSc1TcE1Mz0ktRkhA7IkFAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Invoice#" = _t, Property = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Invoice#", type text}, {"Property", type text}}),
    #"Replaced Value" = Table.ReplaceValue(#"Changed Type","",null,Replacer.ReplaceValue,{"Property"}),
    #"Grouped Rows" = Table.Group(#"Replaced Value", {"Invoice#"}, {{"Count", each List.Min([Property]), type nullable text}, {"Data", each _, type table [#"Invoice#"=nullable text, Property=nullable text]}}),
    #"Expanded Data" = Table.ExpandTableColumn(#"Grouped Rows", "Data", {"Property"}, {"Data.Property"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Data",{"Data.Property"}),
    #"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Count", "Property"}})
in
    #"Renamed Columns"

 

Then the result is as follows.

vtangjiemsft_1-1677650723663.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.