Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Custom Column: Re-using Parameters

I am very new to Power BI, so forgive my novice question!   I know how to create a custom column to convert letter values to number values in a separate column, but there are two problems:   The...
  • MarcelBeug's avatar
    MarcelBeug
    8 years ago

    Thanks for clarification. You can put a sample file somewhere on internet (e.g. OneDrive) and provide the link.

     

    Anyhow, I would add custom columns and use function Text.PositionOf to convert the text to numbers.

    As a final step, you can change the column types to numbers. 

     

     

    let
        Source = Table1,
        #"Added Custom" = Table.AddColumn(Source, "Challenge Score", each Text.PositionOf("USGEO",[Challenge Grade])),
        #"Added Custom1" = Table.AddColumn(#"Added Custom", "Attainment Score", each Text.PositionOf("USGEO",[Attainment Grade])),
        #"Changed Type" = Table.TransformColumnTypes(#"Added Custom1",{{"Challenge Score", Int64.Type}, {"Attainment Score", Int64.Type}})
    in
        #"Changed Type"