Forum Discussion

PCarson00's avatar
PCarson00
Frequent Visitor
2 years ago
Solved

IF conditions for filtering in Power Query

I have a set of data I want to filter in one column but not sure how to go about this. Here is my attempt at the explanation   IF text begins with "L01" or "L04" then remove first 3 characters  ...
  • Ahmedx's avatar
    2 years ago

    pls try this

     

    if Text.Start([DATA],3) ="L01" or Text.Start([DATA],3) ="L04" then Text.RemoveRange([DATA],0,3) else Text.RemoveRange([DATA],0,1)
    
    or========
    if Text.StartsWith([DATA],"L01") or Text.StartsWith([DATA],"L04") then Text.RemoveRange([DATA],0,3) else Text.RemoveRange([DATA],0,1)