Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Insert Column with text based on another column

Hi all ,  New to the Community and also using Power BI , so apologies if the below done not seem clear    I am trying to group clientswhich  have mutiple products , so I first want to know which c...
  • amitchandak's avatar
    5 years ago

    Anonymous , the expected output is not clear.

    A new column like this can help?

     

    New column =
    var _SIPP = countx(filter(Table,[Client Id] =earlier([Client Id]) && [Product Type] = "SIPP"),[Account Number])
    var _Not = countx(filter(Table,[Client Id] =earlier([Client Id]) && [Product Type] <> "SIPP"),[Account Number])
    return
    switch(true(),
    not(isblank(_SIPP)) && not(isblank(_not)), "SIPP and Others",
    not(isblank(_SIPP)) && (isblank(_not)) ,"Only SIPP",
    (isblank(_SIPP)) && not(isblank(_not)) ,"No SIPP",
    "Others"
    )