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
gtexeira
Frequent Visitor

Replace Cell Value with the Cell above

Hi 

 

I am trying to use Power BI query editor to update certain values with the value in the cell right above.  Here is the table:

invoice    product

2000       tire

2001       rim

2003       winshield

2004       Part

2005       seat

2006       Part

 

When ever the product colum contains a cell with Part, I need the power BI editor to replace it with the cell right above.  So the product for invoice 2004 should become windshield and the product for invoice 2006 should become seat.

 

I tried = Table.ReplaceValue(#"Filtered Rows3","Part",each [invoice],Replacer.ReplaceText,{"product"}) but the replaces the cell with the value from the invoice coulmn.

 

Can someone please help me

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @gtexeira ,

 

Right-click on a cell that contains "Part" and, from the context menu, select 'Replace Values'.

Type "null" (with no quotations) into the bottom field, like this:

BA_Pete_1-1694178077577.png

 

Now, select your [product] column and go to the Transform tab > Fill (dropdown) > Down.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

5 REPLIES 5
BA_Pete
Super User
Super User

Hi @gtexeira ,

 

Right-click on a cell that contains "Part" and, from the context menu, select 'Replace Values'.

Type "null" (with no quotations) into the bottom field, like this:

BA_Pete_1-1694178077577.png

 

Now, select your [product] column and go to the Transform tab > Fill (dropdown) > Down.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Thank you @BA_Pete

 

The above suggestion just replaces the Part with a null value.  It does not replace/change to the cell value above.

 

 

BA_Pete_0-1694178859988.png

 

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




That did it! my friend.

 

Thank you

 

Cool, glad that's worked for you.

Have a nice weekend 👍

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




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.

Top Solution Authors
Top Kudoed Authors