Forum Discussion

DROG1025's avatar
DROG1025
New Member
1 year ago
Solved

IF statement without adding new column

Good morning,   I am very new to Power Bi. I am trying to write an if statement for the below data. I have tried copying the syntax from other similar inquiries on this site, but no luck. What I am...
  • SundarRaj's avatar
    1 year ago

    Hi DROG1025 , anothe solution you could try: I have taken certain assumptions here:
    1. YN Number being your first column. If that's not the case, let me know and I'll send the edited version.

     

     

    Here's the code:

    let
    Source = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"YN NUMBER", type text}, {"BIN NUMBER", type text}}),
    RecAsList = Table.TransformRows(#"Changed Type", each _ & [BIN NUMBER = if Text.End(Record.FieldValues(_){0},1) = "A" then "NA" else "Active Not Sourced"]),
    Table = Table.FromRecords(RecAsList)
    in
    Table