Forum Discussion

Bansi008's avatar
Bansi008
Helper III
2 years ago

How do i write syntax to create custom column

Hi All,

I want to create a custom column using a combination of two different columns in the table. For example, i have given sample table below, i want my end output as if Country equals to Canada and Sector equals to cash then new column should populate Cash or else default value as country column. 

 

Someone please help me on this.

 

CountrySectorr
CanadaCash
United StatesGovernment
IndiaCorporate
GermanyGovernment
CanadaCorporate
PolandCash
OmanGovernment
RussiaGovernment
SwedenGovernment

3 Replies

    • mlsx4's avatar
      mlsx4
      Memorable Member

      I'm glad to hear it!

      Please mark as solved for other users who may have the same problem

  • mlsx4's avatar
    mlsx4
    Memorable Member

    Hi Bansi008 

     

    I'm not sure if I have understood what you want to return in the else part (I have put Table[Country]), but you can modify it by [Sectorr]:

    New column = IF('Table'[Country]= "Canada" && 'Table'[Sectorr]="Cash", "Cash",'Table'[Country] )