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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Dan_at_TWE
Helper III
Helper III

Carrying a date field down in a column until a new date is reached

I reading several financial PDFs from a folder into power query. The first couple of lines of each PDF has the date the financial statement covers in the first few lines of the PDF header.  (From QuickBooks if it maters...)

 

Screenshot 2026-03-13 121426.jpg

As you can see if you squint (LOL),  the column in the middle has the string "As of" with the date.  Futher down the imported data that date of course changes, to another period. AKA the next PDF report.

 

Screenshot 2026-03-13 122521.jpg

Before I use row filtering or whatever to remove the report header data I don't need, I would like to use that "As of" string to put together a date column that fills down to subsequent rows. When the power query hits the next "As of" date, fill down using the new date, and so on.

 

Wondering how one would accomplish this... 

1 ACCEPTED SOLUTION
DanieleUgoCopp
Responsive Resident
Responsive Resident

Hello,
I would try  to add a conditional column that checks if the text contains “As of”, if yes extract the date part, otherwise return null, then use Fill Down on that column so the date propagates until the next “As of” row appears, after that you can filter out the header rows you don’t need and keep the filled date column attached to the data rows.

If the date is embedded in the same column as other text you might need a small Text.AfterDelimiter or similar step to isolate the date first, but the general idea is detect the “As of” rows, create the date, then fill down.
Best regards,
Daniele

View solution in original post

5 REPLIES 5
vojtechsima
Super User
Super User

Hey, @Dan_at_TWE ,

here's the code for it, copy paste it to blank query and then take the steps:

  1. Make sure Null is type null (replace "null" with null)
  2. Simply fill down by that column
  3. Transfrom or Create new column with lowering, trimming and extracting date

 

This will work in your blank query if you copy it 1:1, the first step is just generating the sample data.

let
    source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("tZDBCsIwDIZfJfTcQ9YheO12V1BvY4euRBS7Zthu4NurU+eUCbt4CuT7Q36+ohC+dU5IoQPwHtY2ckVnSBMJClV6Az0v5RAcj/tah0AxTIDM+BNoa7n1Y54sEPFx+WSwIUvHzlSO3rEhteNoHHx/UfjiP2rlXDfGX0Bn+WQ3Z7wl2B6I4gT/kLLijureCv7PipplZTnLSnkF", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]),
    replacedValue = Table.ReplaceValue(
        source,
        "null",
        null,
        Replacer.ReplaceValue,
        {"Column1", "Column2", "Column3"}
    ),
    filledDown = Table.FillDown(
        replacedValue,
        {"Column2"}
    ),
    custom1 = Table.TransformColumns(
        filledDown,
        {
            {
                "Column2", 
                each Date.From(Text.AfterDelimiter(Text.Lower(_), "as of "), "en-US"), 
                type date
            }
        }
    )
    in
        custom1

 






Any kudos or recognition appreciated. To learn more on the topic, check out my blog and follow me on LinkedIn.

Hi @Dan_at_TWE ,

Thanks for reaching out to the Microsoft fabric community forum. 

 

I would also take a moment to thank @vojtechsima   , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you .

 

Best Regards, 
Community Support Team

danextian
Super User
Super User

You should be able to use fill down assuming that all other rows in that column are null until the next "as of date". After that, you can replace "As of " with nothing and then you can parse the column as date.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
DanieleUgoCopp
Responsive Resident
Responsive Resident

Hello,
I would try  to add a conditional column that checks if the text contains “As of”, if yes extract the date part, otherwise return null, then use Fill Down on that column so the date propagates until the next “As of” row appears, after that you can filter out the header rows you don’t need and keep the filled date column attached to the data rows.

If the date is embedded in the same column as other text you might need a small Text.AfterDelimiter or similar step to isolate the date first, but the general idea is detect the “As of” rows, create the date, then fill down.
Best regards,
Daniele

I ended up doing something similar.  

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.