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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Thomas_MedOne
Helper III
Helper III

Copying column value until value changes then new value

I have this system that outputs log files but it does so in an infuriating way. The data pretty much looks like this (with more columns)

 

Call IDFromToResultDate/Time
11111222614-111-1212614-555-1212Queue 112/31/2024 10:03:00
 614-111-1212614-555-1212IVR OPT 112/31/2024 10:03:00
 614-111-1212614-555-1212voicemail12/31/2024 10:03:00
11111223614-222-1212614-555-1212Queue 112/31/2024 10:05:35
 614-222-1212614-555-1212IVR OPT 112/31/2024 10:05:35
 614-222-1212614-555-1212voicemail12/31/2024 10:05:35

 

So, essentially the CSV is sort of pivoted, I guess. I don't know what you call it and, of course, this is only sample information. What I need is some sort of power Query script or something else which will duplicate the 11111222 to the other two blank lines and then when it hits 11111223 it then copies that 1111223 to the next two blank lines, etc.

There may be 3 blanks, 5 blanks depending on the routing, or any other number of blanks.  This way I can report on the routing of these calls.

 

What is possible? Do I automate it in excel before sending the CSV to Power BI or do something in Power BI in Power Query?

1 ACCEPTED SOLUTION
watkinnc
Super User
Super User

Why that just sounds like you need to use Table.FillDown on the GUI. if they are not actually null values,  replace that value with nulls and then fill down.

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

View solution in original post

5 REPLIES 5
v-pnaroju-msft
Community Support
Community Support

Hi @Thomas_MedOne,

 

We sincerely appreciate your inquiry through the Microsoft Fabric Community Forum.

 

Please find below the process to use Power Query for filling down the Call ID values:

  1. Load the Text/CSV file data into Power BI.
  2. After loading the data, click on Transform Data to open the Power Query Editor.
  3. Inspect the Call ID column, where blank rows need to be filled. Replace the blank values with Null if blank cells are not already recognised as nulls.
  4. Select the Call ID column, navigate to the Transform tab, click on Fill, and choose Down. This will fill all blank cells in the column with the last non-blank value above them.
  5. Preview the data to ensure that all blank rows under the Call ID column have been correctly filled with the appropriate values.
  6. Click on Close & Apply in the Home tab of the Power Query Editor to load the data back into Power BI with the filled Call ID values.

Please find the attached screenshot and PBIX file for your reference:

vpnarojumsft_0-1736177095955.png

If you find this response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members facing similar queries.

 

Thank you.

Omid_Motamedise
Resident Rockstar
Resident Rockstar

Just right click on the column call ID, and then select fill down. 

This was the solution but Watkinnc was just a bit closer because I tried this and it didn't work. I had to convert them to nulls first.

watkinnc
Super User
Super User

Why that just sounds like you need to use Table.FillDown on the GUI. if they are not actually null values,  replace that value with nulls and then fill down.

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

Thanks, I had tried fill down but I didn't know about the nulls. They were "blanks" so I converted them to nulls and i'm in business. Thanks.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.