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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
amalrio
Helper V
Helper V

how to repeat column value in PowerQuery

Hi Gurus, 

 

I have two columns in PoweBI, I want to repeate category name and subcategoty name until  there is a new value, 

 

I want to know how to get it done in Power Query.

 

amalrio_0-1608536259985.png

 

 

my current tabel and expected values are showen in the image below. 

 

 

 

 

Thanks a lot for your help in advance

1 ACCEPTED SOLUTION

Ah, sorry, I didn't look carefully enough at your image, got too excited about fill down! lol

This function only works on 'null' values, so you'll need to select the column, click 'Replace Values'

AllisonKennedy_0-1608537117951.png

Then use fill down.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@amalrio , There can be few ways.One can be.

Make all Test as null . In power Query -> Right click on Column and Replace "Test" with:  null

Then use Fill Down - > https://www.excelcampus.com/powerquery/fill-down-blank-null-cells-power-query/

 

Replace remaining null with Test

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
AllisonKennedy
Community Champion
Community Champion

@amalrio  This is one of my favourite Power Query functions. 

 

UPDATE: I forgot to mention that it only works on null values, then picks up next non null value, so first you must: 

Select the column,

Click Transform tab, 

click 'Replace Values'

Replace 'Test' with 'null' (spelling must be exact match).

AllisonKennedy_0-1608537117951.png

 

Then click Fill > Down.

 

AllisonKennedy_0-1608536613338.png

 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Hi @AllisonKennedy ,

 

thanks for the reply, but it did do anythin to to get me the expected table as in the image.

Ah, sorry, I didn't look carefully enough at your image, got too excited about fill down! lol

This function only works on 'null' values, so you'll need to select the column, click 'Replace Values'

AllisonKennedy_0-1608537117951.png

Then use fill down.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

@amalrio ,

There can be few ways.One can be.

Make all Test as null . In power Query -> Right click on Column and Replace "Test" with:  null

Then use Fill Down - > https://www.excelcampus.com/powerquery/fill-down-blank-null-cells-power-query/

 

Replace remaining null with Test

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

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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