none
How to Remove blank tables in power query quickly RRS feed

  • Question

  • Hi there,

    I want to remove blank columns quickly in one step

    For Example

    Column 1  Column 2    Column 3  Column 4    Column 5  Column 6

    no blank     Blank         Blank       not blank        Blank       Blank

    Blank columns position may vary from column 2 to column 1 in above mentioned example


    Hayder Alee

    Friday, May 31, 2019 7:15 AM

Answers

  • Hi Haider,

    Try this code:

    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        final = Table.SelectColumns(Source, Table.SelectRows(Table.Buffer(Table.Profile(Source)), each [Count] <> [NullCount])[Column])
    in
        final

    before:

    after:

    Friday, May 31, 2019 3:10 PM

All replies

  • Hi Haider,

    Try this code:

    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        final = Table.SelectColumns(Source, Table.SelectRows(Table.Buffer(Table.Profile(Source)), each [Count] <> [NullCount])[Column])
    in
        final

    before:

    after:

    Friday, May 31, 2019 3:10 PM
  • please share workbook on haider.ali7333@gmail.com.

    Hayder Alee

    Friday, May 31, 2019 3:21 PM
  • Email was sent.
    Friday, May 31, 2019 3:24 PM