Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Delete date value from text column

Hello Power BI Community,   I have a question on how to remove a date value from a column. Due to the less than optimal layout of the data in the original file, I need to do some data manipulation ...
  • m_dekorte's avatar
    2 years ago

    Hi Anonymous 

     

    Give something like this a go.

    let
      Source = Table.FromColumns(
        {
          {#date(2023, 12, 19), "", null, "HeaderRow1", "HeaderRow2"}, 
          {"", "", "Period", "P1", "P2"}
        }
      ), 
      ReplaceValue = Table.ReplaceValue(
        Source, 
        each [Column1], 
        each if [Column1] is date then null else [Column1], 
        Replacer.ReplaceValue, 
        {"Column1"}
      )
    in
      ReplaceValue

    I hope this is helpful