cancel
Showing results for 
Search instead for 
Did you mean: 
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

Accepted Solutions
Microsoft v-yulgu-msft
Microsoft

Re: filling blanks with previous column text

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
Super User I
Super User I

Re: filling blanks with previous column text

@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


Did I answer your question? Mark my post as a solution.
Proud a to be a Datanaut!
Sushmach109 Helper I
Helper I

Re: filling blanks with previous column text

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,

Super User I
Super User I

Re: filling blanks with previous column text

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


Did I answer your question? Mark my post as a solution.
Proud a to be a Datanaut!
Microsoft v-yulgu-msft
Microsoft

Re: filling blanks with previous column text

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

Highlighted
Sushmach109 Helper I
Helper I

Re: filling blanks with previous column text

Thanku.

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors