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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Bakhtawar
Post Patron
Post Patron

Remove null values from data

I have 20 + tables and also there is a lot more columns so this is not possible to filter out null values one by one on each column so is there any alternative to remove null values from whole dataa

 

any help 

14 REPLIES 14
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Bakhtawar ,

By my tests, we could achieve that filter all null values for mutiple columns at one time with the M Query below.

#"Filtered Rows" = Table.SelectRows(#"Changed Type", each List.Contains(Record.ToList(_),null)=false)

Here is the output.

Untitled.png

I'm not good at M query, may @ImkeF will have the better solutions. 

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

can i paste this as it is or i should do some modifications? Table.SelectRows(#"Changed Type", each List.Contains(Record.ToList(_),null)=false)

Hi @Bakhtawar ,

Have you solved the problem?

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

If you still need help, please feel free to ask.

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

no.. i did not understand about change type

Hi @Bakhtawar ,

This is the step "Change type".

change type.PNG

You could copy and paste my code after the "Change type " step.

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

so this is for whole table  or only for 1 column

Hi @Bakhtawar ,

My code from my first reply is for the whole table.

Have you tried it in your advanced editor?

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

from your first i saw this 

Table.SelectRows(#"Changed Type", each List.Contains(Record.ToList(_),null)=false)

now i want to ask what is here changed type here .. here i replace with my table name from change type or something else 

Hi @Bakhtawar ,

Here is my complete code in Advanced Editor.

let
    Source = Excel.Workbook(File.Contents("C:\Users\cherryg\Desktop\Book1.xlsx"), null, true),
    Sheet22_Sheet = Source{[Item="Sheet22",Kind="Sheet"]}[Data],
    #"Promoted Headers" = Table.PromoteHeaders(Sheet22_Sheet, [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Date", type date}, {"value", Int64.Type}, {"Date_1", type date}, {"Sales", Int64.Type}, {"Wegnr.", type text}, {"Groengebied", type text}, {"Elementnummer", Int64.Type}, {"Oppervlakte (m²)", type number}, {"Lengte (m)", type number}, {"Id", Int64.Type}, {"Number", Int64.Type}, {"Codes", Int64.Type}, {"Wegnr", type text}, {"Element", type text}, {"Van_HM", type number}, {"Tot_HM", type number}, {"Dwarsprofiel", type text}, {"Opp. m²", Int64.Type}, {"Lengte m1", Int64.Type}, {"Beheertype", type text}}),
    #"Filter rows"=Table.SelectRows(#"Changed Type", each List.Contains(Record.ToList(_),null)=false)
in
    #"Filter rows"

Please modify your code based on your scenario.

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-piga-msft  ?? help plz

HI this is what i supposed to asking what i replace here "

Changed Type

table name or something else 

Hi @Bakhtawar ,

if you have trouble integrating the sample code into your solution, you might check out this video: http://community.powerbi.com/t5/Webinars-and-Video-Gallery/Power-BI-Forum-Help-How-to-integrate-M-co... 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Hi @Bakhtawar ,

If you provious step is "Changed type", you could copy my query and paste it in Advanced Editor.

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Cherry (@v-piga-msft ),

you've obviously learned a lot M meanwhile - cannot think of a better solution than this 😉

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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