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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Sushmach109
Helper I
Helper I

filling blanks with previous column text

Hi team,

 

I need to fill the current blanks values with previous row data.

I tried but able to find the solution.Can you please try to give Solution.

 

Colulmn1

A

null

null

B

null 

null

 

Expected Result

 

Column

A

A

A

B

B

B

 

Thanks,

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @Sushmach109,

 

Add an index column first.

1.PNG

 

Create a calculated column with below DAX formula.

Required Result =
IF (
    Table_1[Column2] = BLANK (),
    CALCULATE (
        LASTNONBLANK ( Table_1[Column2], 1 ),
        FILTER ( Table_1, Table_1[Index] < EARLIER ( Table_1[Index] ) )
    ),
    Table_1[Column2]
)

2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yulgu-msft
Employee
Employee

Hi @Sushmach109,

 

Add an index column first.

1.PNG

 

Create a calculated column with below DAX formula.

Required Result =
IF (
    Table_1[Column2] = BLANK (),
    CALCULATE (
        LASTNONBLANK ( Table_1[Column2], 1 ),
        FILTER ( Table_1, Table_1[Index] < EARLIER ( Table_1[Index] ) )
    ),
    Table_1[Column2]
)

2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanku.

vanessafvg
Super User
Super User

@Sushmach109  you can use the fill down function in query editor

 

go to the transform menu on the ribbon and select fill  and then down





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




This is very dynamic and is not one time transformation.

What is equalent dax formula for this?

 

Column1 Column2     Required Result

 

ticket1     A                 A

ticket1    null               A

ticket1    null               A

ticket2    B                   B

ticket2    null               B

ticket2    null               B

ticket2    C                   C

ticket2    null                C

 

Thanks,

@Sushmach109 the solution i posted is dynamic, whatever data is loaded will have that applied to it everytime





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.