Forum Discussion

Chips2220's avatar
Chips2220
Regular Visitor
3 years ago
Solved

If text contains then multiple

Hi    I'm new to power query. I'm trying to create a custom column which says, 'if text in column A contains the word 'monthly' then divide value in column B by (5 * 4)   How would that look in a...
  • Chips2220's avatar
    3 years ago

    if Text.Contains([Value.1], "Monthly", Comparer.OrdinalIgnoreCase) then ([Value]/22) else if Text.Contains([Value.1], "Weekly", Comparer.OrdinalIgnoreCase) then ([Value]/5) else if Text.Contains([Value.1], "Fortnightly", Comparer.OrdinalIgnoreCase) then ([Value]/10) else [Value]

     

    this worked