Forum Discussion

ilTac's avatar
ilTac
Frequent Visitor
4 years ago
Solved

Conditional Column Power Query (M): how to repeat the value for some rows and then change the value

Hi everyone,

i'm trying to achieve the follow in power query:

 

here's what i have as native database 

 and this is what i wolud like:

so basically take one value from first column and repeat for some amout of rows.

I was trying with index and referst to previuos row but of course this won't work.

 

Do you think it is possible to achive this?

Does anyone has some hints on how to do it?

 

Thanks in advance!

  • Hi ilTac ,

     

    Try to add a column with the following code:

    if (try Date.FromText([Date]) otherwise null) = null then [Date] else null

    Then do a fill down on that new column

  • Hi MFelix 

    i dind't know about the fill down option.

    Thank you very much, solved.

2 Replies

  • Hi ilTac ,

     

    Try to add a column with the following code:

    if (try Date.FromText([Date]) otherwise null) = null then [Date] else null

    Then do a fill down on that new column

    • ilTac's avatar
      ilTac
      Frequent Visitor

      Hi MFelix 

      i dind't know about the fill down option.

      Thank you very much, solved.