Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Amardeep100115
Post Prodigy
Post Prodigy

remove "null" cell from columns

Hi Super Users,

 

How we can filter or remove null cell crom column while extracting headers from table column in power query

 

AB
1 ACCEPTED SOLUTION

Hi @Amardeep100115 ,

 

You can use  a M-code such as below:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUQKhWJ1oEJ0CYydBxNNgEulIimDMFBg7FgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {}, "Attribute", "Value"),
    #"Filtered Rows1" = Table.SelectRows(#"Unpivoted Columns", each ([Value] <> "")),
    #"Filtered Rows" = Table.SelectRows(#"Filtered Rows1", each ([Value] <> ""))
in
    #"Filtered Rows"

 

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

5 REPLIES 5
Greg_Deckler
Super User
Super User

Should be able to click on the drop down for the column and remove (filter out) the nulls/blanks.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thank you!

but it should be dynamically filter in query editor not more adding step. i have date columns where null valued are there and my dataflow is not getting refresh it. hence seeking for help

AB

Hi @Amardeep100115

 

I‘m a little confused about "dynamical filter" and "no more adding step".

But as for "Remove null cells from columns while extracting the headers",you can go to query editor,then select all the column>click on "unpivot columns":

Annotation 2020-04-07 160159.png

And you will see:

Annotation 2020-04-07 160307.png

Finally click on the dropdown botton of column value >unselect "blank":

Annotation 2020-04-07 160416.png

 

All the null cells have been removed.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
 

Thanks you @v-kelly-msft 

 

i understand the solution but i am still looking for win m-code, where we can filter null from columns atleast from one column where i have date

AB

Hi @Amardeep100115 ,

 

You can use  a M-code such as below:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUQKhWJ1oEJ0CYydBxNNgEulIimDMFBg7FgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {}, "Attribute", "Value"),
    #"Filtered Rows1" = Table.SelectRows(#"Unpivoted Columns", each ([Value] <> "")),
    #"Filtered Rows" = Table.SelectRows(#"Filtered Rows1", each ([Value] <> ""))
in
    #"Filtered Rows"

 

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.