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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors
Top Kudoed Authors