Forum Discussion

ifillingham's avatar
ifillingham
Frequent Visitor
4 years ago
Solved

Replace values in a column based on values in a different column

I wonder if someone can help me.   I have a table of student information in Power query with the following layout:   Year Group Subject Code 10 Ss 11 Ss 12 Ss 13 Ss 11 Pe ...
  • ifillingham's avatar
    4 years ago

    I've found the solution so wanted to close this before anyone commented!!

     

    I created a custom column:

     

    Table.AddColumn(#"Capitalized Subject code", "Change KS5 Ss to Pe", each if [Subject Code] = "Ss" and [YearCode] >= 12 then "Pe" else [Subject Code])

     

    "Capitalized Subject code" and  "Change KS5 Ss to Pe" refer to parts of the puery to make it easier for mne to follow what I did so I can do it again if I need to!!