Forum Discussion

struggle's avatar
struggle
Helper II
1 year ago
Solved

Creating custom columns keeps returning a structured Table column

For example, since Power Query isn't able to autoconvert the column Date, which is in yyyymmdd format, into date format, I've been trying to convert it using different custom column calculations, but every time I attempt this, I either get an error or a structured column filled with Table links. When I try to expand the resulting Proper Date column, I end up with extra rows. How do I fix this?

 

  • jgeddes's avatar
    jgeddes
    1 year ago

    If you are using the UI to add a column you do not need to write "Table.AddColumn". You would only need to write everything you have after the 'each' 

15 Replies

    • struggle's avatar
      struggle
      Helper II

      My default is en-US, though - I don't see how specifying en-US would change that, or what culture I would have to specify othrewise. My main is that the output comes as links to a separate Table.

      • jgeddes's avatar
        jgeddes
        Super User

        What code are you writing to add your column that results in a table?

  • struggle 

     

    Hi, you may need to change your data in 'Date' column to a 'Text' data type before your Add Column step. 

    I used some random data and gave it a try with below M and it works

    = Table.AddColumn(#"Changed Type", "Custom", each #date(
        Number.FromText(Text.Start([Date], 4)),
        Number.FromText(Text.Middle([Date], 4, 2)),
        Number.FromText(Text.End([Date], 2))
    ))

     

     

    Hope it helps:)

    • struggle's avatar
      struggle
      Helper II

      I do get the correct dates, but they're still behind Table links in the resulting column.

       

      • MasonMA's avatar
        MasonMA
        Super User

        Now I'm not sure i understand your question.

         

        Could you paste all your M code here?