Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Adding specific vales to a filtered table

Hi Everyone I have a table call Customer Table, that has customer names and their Region. I cannot edit the table due to it being a corporte database. The problem i am trying to solved is that when ...
  • Anonymous's avatar
    Anonymous
    5 years ago

    hi, for this specific case, you could create a calculate column in PowerBI with the next formula:

     

    Region2 = IF( OR('Customer Table'[Region] = "North America",
    OR('Customer Table'[Customer Name] = "Customer Nmae 7",
    'Customer Table'[Customer Name] = "Customer Nmae 8")
    ),"North America",'Customer Table'[Region])

     

    You also can create a flag column based in 'Customer Name' Column, and then create a formula with the region and flag column.

     

    Customer Name        |   Region            | Flag (Based on Customer Name)

    Customer Name 1     | North America  | 0

    Customer Name 2     | North America  | 0

    .

    .

    Customer Name 7     | Mexico              | 1

    Customer Name 8     | Mexico              | 1

    Customer Name 9     | Mexico              | 0

    Customer Name 10   | Mexico              | 0

     

    Region 2 = If( OR('Customer Table'[Region] = "North America", 'Customer Table'[Flag] = 1),

                                 "North America", 'Customer Table'[Region])

     

    Regards