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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
goldgate
New Member

How to fill down values in one column based upon distinct values in another?

Hello.

 

I have a dataset which has gaps in a certain column ('Updates') I would like to fill down according to the distinct values in another column ('Server'):

goldgate_1-1705404155849.png

The values in 'Update' are always in the first unique 'Server' row. However, as not every unique value in the 'Server' column has a number in 'Updates', if I were to fill down in the usual way, 'Updates' values would fill down and spill over into rows corresponding to unrelated 'Server' values, which I do not want.

 

Therefore, I want to develop a custom function capable of filling down values in the 'Updates' column via the Table.FillDown() function for each respective unique value in the 'Server' column.

 

However, I am very new to for-loops in Power Query, and I would appreciate some guidance on how to build one for this function.

 

I presume it would be structured like this:

  1. Use the List.Distinct() function to find unique 'Server' values
  2. Select the first row per unique 'Server' value to get 'Updates' value
  3. Use the Table.FillDown() 'Updates' value per unique 'Server' value to achieve the fill down.

Any assistance with this would be very much appreciated. Many thanks for reading. 

1 ACCEPTED SOLUTION
slorin
Super User
Super User

Hi

 

= Table.Combine(
Table.Group(
Your_Source,
{"Server"},
{{"Data", each Table.FillDown(_,{"Updates"}), type table [Server=number, Events=number, Updates=nullable number]}}
)[Data]
)

Stéphane 

View solution in original post

6 REPLIES 6
slorin
Super User
Super User

Hi @macolmedo10 

replace "Server" by "Location" and "Updates" by "Bayer Name"

= Table.Combine(
Table.Group(
Your_Source,
{"Location"},
{{"Data", each Table.FillDown(_,{"Bayer Name"})}}
)[Data]
)

Stéphane

I am not sure what i am doing wrong but it is giving me an error

macolmedo10_1-1724912365260.png

 

I am really new .  when you mean source it is the excel source yes?

macolmedo10
Frequent Visitor

Hi, i have similar problem may you please help me with this?

 

macolmedo10_0-1724857177390.png

 

slorin
Super User
Super User

Hi

 

= Table.Combine(
Table.Group(
Your_Source,
{"Server"},
{{"Data", each Table.FillDown(_,{"Updates"}), type table [Server=number, Events=number, Updates=nullable number]}}
)[Data]
)

Stéphane 

Thank you so much! This worked perfectly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors