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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
AnushaK
Regular Visitor

Need help with the Power Query

Hi Everyone,

 

I have just started to work on Power BI. I am stuck currently.

In the table, if there is a null value for a row, I want to create new rows and copy previous date's data in the rows but not the date. Date's value I want to copy from other column.

Below tables will give the idea of my problem and the output I need.

IMG_20240507_141509.jpg

And the output table I need is as below-

IMG_20240507_141457.jpg

 Can someone please help me with this?

 

 

1 ACCEPTED SOLUTION
AlienSx
Super User
Super User

let
    Source = your_table,
    group = Table.Group(
        Source, "DateRange",
        {{"x", (x) => if x[Date]{0} = null then null else x},
        {"Date", (x) => if x[Date]{0} = null then x[DateRange]{0} else x[Date]{0}}}
    ),
    down = Table.FillDown(group, {"x"}),
    xpand = Table.ExpandTableColumn(down, "x", {"Transactions"})
in
    xpand

View solution in original post

3 REPLIES 3
AlienSx
Super User
Super User

let
    Source = your_table,
    group = Table.Group(
        Source, "DateRange",
        {{"x", (x) => if x[Date]{0} = null then null else x},
        {"Date", (x) => if x[Date]{0} = null then x[DateRange]{0} else x[Date]{0}}}
    ),
    down = Table.FillDown(group, {"x"}),
    xpand = Table.ExpandTableColumn(down, "x", {"Transactions"})
in
    xpand

Got it! It's working fine!! Thank you so so much @AlienSx 

Thank you so much @AlienSx . Will try this. But I need to add rows as well. Number of rows to be added depends on number of transactions present for the previous date.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.