Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a cash flow timeline and some columns (representing years) have values of 0 throughout the entire column. There are some columns that contain 0s, but also contain other numbers, which I need to keep.
So I am looking to remove columns that contain only a certain value, in this case 0.
Solved! Go to Solution.
Hi @tc5pt
As tested, the methods provided by this article should be helpful.
Automatically Remove Empty Columns And Rows From A Table In Excel Using Power Query
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @tc5pt
As tested, the methods provided by this article should be helpful.
Automatically Remove Empty Columns And Rows From A Table In Excel Using Power Query
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Nolock
This code will remove all your empty columns
Col1 Col2 Col3 Col4
5 7
12 10
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Col 1", Int64.Type}, {"Col 2", type any}, {"Col 3", Int64.Type}, {"Col 4", type any}, {"Col 5", Int64.Type}, {"Col 6", type any}, {"Col 7", Int64.Type}}),
Unpivoted = Table.UnpivotOtherColumns(#"Changed Type", {}, "Attribute", "Value"),
ColumnName = Table.Distinct(Unpivoted, {"Attribute"})[Attribute],
Custom1 = Table.SelectColumns(Source, ColumnName)
in
Custom1Replace your cells with a 0 by null and like that you will be able to remove your columns with 0
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 10 | |
| 6 | |
| 5 | |
| 5 | |
| 2 |