Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Bansi008
Helper II
Helper II

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 3
Bansi008
Helper II
Helper II

I got the solution. Thanks for your reply

I'm glad to hear it!

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

mlsx4
Super User
Super User

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] )

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.