Forum Discussion

cristianml's avatar
cristianml
Icon for Post Prodigy rankPost Prodigy
5 years ago
Solved

Costume formula issue in Editor

Hi,   I need to create a custom column with the following formula in the query editor but it gives me an error : IF([#"Type / Cost Center Career Track"]="Subcontractor","Subcontractor",IF([#"Type ...
  • v-yalanwu-msft's avatar
    4 years ago

    Hi, cristianml ;

    You could modify it as follows:

     

    = Table.AddColumn(#"Replaced Value", "Custom", each if [#"Type/Cost Center Career Track"] = "Subcontractor" then "Subcontractor" else if [#"Type/Cost Center Career Track"] = "Unassigned" then "Unassigned" else "0"&[Level])

     

    "If " in power query : if ...then... else

    "If" in dax: IF(<logical_test>, <value_if_true>[, <value_if_false>])

    The final output is shown below:

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.