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
Chrisjr
Helper IV
Helper IV

Fill down non null values

Hello all, 

 

I have the following column: 

Name1
5
6
4
Name2
5
9

 

l would like to fill down the cells with numbers by the name1 and name2. How can I do this. I have tried to change the cells with numbers by blank values and fill them down but this does not work. 

 

expected result:

 

Name1
Name1
Name1
Name1
Name2
Name2
Name2

 

Thanks for the help,

Chris

2 ACCEPTED SOLUTIONS
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @Chrisjr 

 

Please do the followng in Power Query:

base table

Mikelytics_0-1670318987546.png

add a custom column

Mikelytics_1-1670319344547.png

try (if Number.FromText([Column]) > 0  then null else null) otherwise [Column]

*you can also take something like <> 0  if you also have values below 0

 

 

Execute the fill

Mikelytics_2-1670319388140.png

Delete the old column

Mikelytics_3-1670319407984.png

Mikelytics_4-1670319432046.png

 

 

 

Best regards

Michael

-----------------------------------------------------

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

@ me in replies or I'll lose your thread.

-----------------------------------------------------

LinkedIn

 

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

View solution in original post

@Chrisjr , just adding to @Mikelytics  solution. If you want to replace the values and do the fill down in a same column without duplicating and deleting the columns, Please try the below code in your replace value step.

= Table.ReplaceValue(Source,each [Name],
each if Number.FromText([Name]) > 0 then null else [Name],
     Replacer.ReplaceValue,{"Name"})

Arul_0-1670321375419.png

 

Thanks,





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


View solution in original post

6 REPLIES 6
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @Chrisjr 

 

Please do the followng in Power Query:

base table

Mikelytics_0-1670318987546.png

add a custom column

Mikelytics_1-1670319344547.png

try (if Number.FromText([Column]) > 0  then null else null) otherwise [Column]

*you can also take something like <> 0  if you also have values below 0

 

 

Execute the fill

Mikelytics_2-1670319388140.png

Delete the old column

Mikelytics_3-1670319407984.png

Mikelytics_4-1670319432046.png

 

 

 

Best regards

Michael

-----------------------------------------------------

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

@ me in replies or I'll lose your thread.

-----------------------------------------------------

LinkedIn

 

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

@Mikelytics thanks for the clear steps

Chrisjr
Helper IV
Helper IV

 HI @Arul Thanks for your reply. 

I thought about this solution but how do you replace by null values?

@Chrisjr , just adding to @Mikelytics  solution. If you want to replace the values and do the fill down in a same column without duplicating and deleting the columns, Please try the below code in your replace value step.

= Table.ReplaceValue(Source,each [Name],
each if Number.FromText([Name]) > 0 then null else [Name],
     Replacer.ReplaceValue,{"Name"})

Arul_0-1670321375419.png

 

Thanks,





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


HI @Arul 

Awesome addon which makes the solution more lean! Will definietely put this in my toolbox 🙂 Thank you!

 

Best regards

Michael

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!
Arul
Super User
Super User

@Chrisjr ,

Instead of replacing values with blank you can replace values with null and then use fill down. 

Thanks,





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


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.