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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors