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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Super User
Super User

@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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.