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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Automatically fill field using M Language

Hi, I have a table below: 

Rick_ferreira_0-1608740275038.png

and i have  a second table:

Rick_ferreira_1-1608740307085.png

I need to join the two tables in one table.
I used:

 
 
 

ggg.png

and i got:

 
 
 

g4.png
But, now I need the power bi query to fill in the team field automatically, placing the corresponding team

 

G6.png

Can someone help me do this using M language?. Thanks

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Anonymous 

Check the attached file please: After Appending as you did, you need to add the following step:

You can download the file: HERE

= Table.ReplaceValue(#"Appended Query",null, each let x=_[ID] in Table.SelectRows(#"Appended Query", each [ID] =x  and [TEAM] <> null)[TEAM]{0},Replacer.ReplaceValue,{"TEAM"})

 

Fowmy_0-1608752148995.png

 

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


Website YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

4 REPLIES 4
Fowmy
Super User
Super User

@Anonymous 

Check the attached file please: After Appending as you did, you need to add the following step:

You can download the file: HERE

= Table.ReplaceValue(#"Appended Query",null, each let x=_[ID] in Table.SelectRows(#"Appended Query", each [ID] =x  and [TEAM] <> null)[TEAM]{0},Replacer.ReplaceValue,{"TEAM"})

 

Fowmy_0-1608752148995.png

 

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


Website YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

TomMartens
Super User
Super User

Hey @Anonymous ,

 

instead of messing around with "Fill Down" opeations I would first create a merge operation to pull the team column into table 2 (using the ID column as join column), after that I would execute the append operation.

 

Hopefully, this provides some new ideas on how to tackle the challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
amitchandak
Super User
Super User

@Anonymous , In case DAX you cn have a column like

 

new column =
var _max= maxx(filter(table, [id] = earlier([id]) && not(isblank([team]))),[Team])
return
if(isblank([team]),_max,[Team])

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks, but  i need using languagem M in power bi query and i can not use dax.

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.