Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
Hello,
i have a strange way of working in filter step.
i have rows within there is the remorque word.
i want to keep the rows that not start with "remorque"
Table.SelectRows(#"Récupération Grp", each not Text.StartsWith([Genre Machine], "REMORQUE"))
so far so good, but the filter removes also null rows
is it normal ?
thanks
Solved! Go to Solution.
Hello @GeekAlfPro ,
Please use the below modified code to retain the null values..
Table.SelectRows(#"Récupération Grp", each [Genre Machine] = null or not Text.StartsWith([Genre Machine], "REMORQUE"))
If you find this helpful , please mark it as solution and Your Kudos are much appreciated!
Thank You
Dharmendar S
Nulls have special behavior.
Text.StartsWith(null, "REMORQUE" ) = null
thus
not Text.StartsWith(null, "REMORQUE" ) = not null = null
Since Table.SelectRows only chooses rows where the condition evaluates to true, you lose the null rows.
To fix this, here are a couple of options:
1. Handle null explicitly.
each [Genre Machine] = null or not Text.StartsWith([Genre Machine], "REMORQUE"))
2. Use the coalesce operator to replace null with something else like the emty string.
each not Text.StartsWith([Genre Machine] ?? "", "REMORQUE")
Hello @GeekAlfPro ,
Please use the below modified code to retain the null values..
Table.SelectRows(#"Récupération Grp", each [Genre Machine] = null or not Text.StartsWith([Genre Machine], "REMORQUE"))
If you find this helpful , please mark it as solution and Your Kudos are much appreciated!
Thank You
Dharmendar S
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
17 | |
9 | |
8 | |
7 | |
7 |