Forum Discussion

igaca's avatar
igaca
Helper III
10 years ago
Solved

Power Query - removing all columns with no values?

Hi,   Am wondering if someone has worked out a way to remove all columns containing no values (as in null / nothing...no zeroes) without checking each column in a query from its drop-down to check?...
  • Anonymous's avatar
    Anonymous
    10 years ago

    Hi igaca,

     

    Based on my understanding, you want to remove the null value column with power query, right?

    If as I said, you could follow below steps:

     

    1. Create a test table, and load it to power bi, click 'edit query'.

     

     

    2. Select all of the table and click the ‘Unpivoted Columns’.

     

     

     3. Choose the first Column and click ‘Removed duplicates’, then modify the query to remove the second column.

    Modify:

    Table.Distinct(#"Unpivoted Columns", {"Attribute"})  =>  Table.Distinct(#"Unpivoted Columns", {"Attribute"})  [Attribute]

     

    4. Click on ‘fx’ to add a custom step:

     

    Use Table.SelectCoulmns function to get the specify columns:

     

     

    For more detail info, you could refer to below link:

    Video_017 How to Remove Null Columns with Power Query?

     

    Regards,

    Xiaoxin Sheng