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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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