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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
agd50
Helper V
Helper V

Conditional M Code - Removing a whole value from column IF a character is there

I want to remove an entire value if there is a "+" symbol, so it will be blank.

Example: "123+456" - I want this whole value removed (change to null)
How to achieve this in power query?

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

This M code works

let
    Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
    #"Uppercased Text" = Table.TransformColumns(Source,{{"Data", each if Text.Contains(_,"+") then null else _}})
in
    #"Uppercased Text"

Hope this helps.

Ashish_Mathur_0-1759372923130.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

1 REPLY 1
Ashish_Mathur
Super User
Super User

Hi,

This M code works

let
    Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
    #"Uppercased Text" = Table.TransformColumns(Source,{{"Data", each if Text.Contains(_,"+") then null else _}})
in
    #"Uppercased Text"

Hope this helps.

Ashish_Mathur_0-1759372923130.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.