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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Shaji
Helper I
Helper I

Need Help

Hi All,

 

I have table with muliple columns inlcusing the below two:

EventType
AAACust123
BBBCust123
AAACP
BBBCP
AAAB2B
BBBB2B

 

now based on the above two column I want a third column named NewType which should ideally be:

 

EventTypeNewType
AAACust123Customer
BBBCust123Other
AAACPPartner
BBBCPPartners
AAAB2BTop
BBBB2BOtherTop

 

What DAX should I write to achieve the above third column?

1 ACCEPTED SOLUTION

Hi @Shaji ,

 

 

You can use SWITCH also

 

SWITCH(

TRUE(),

 

Table'[Event] = "AAA" && Table[Type] = "Cust123", "Customer",

Table'[Event] = "BBB" && Table[Type] = "Cust123", " Other Customer"

 

)

 

Regards

HN

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

I see that the SWITCH true statement only checks single column value. In my question I need to check Two COlumns and then print the results.

harshnathani
Community Champion
Community Champion

Hi @Shaji ,

 

Can you share the logic of the 3rd Column.

 

How do you identify if he is a customer, partner or others.

 

Regards,

HN

So basicall we have two type of Event. IN the example it is AAA and BBB. And for each event there is a set of "Type" which will be common to both AAA and BBB. 

 

So now if Event = AAA and Type=Cust123 i should get the NewType = Customer

similarly if Event = BBB and Type=Cust123 i should get the NewType = Other

 

So based on Column Event and Type I should get the result in NewType.

 

Hope you can get some idea on what I am looking for

Hi @Shaji ,

 

Not sure how will you replace Cust123 with Customer, etc... How many combinations like this do you have.

 

You can try this.

 

Column = IF('Table'[Event] = "BBB", CONCATENATE("Other " , 'Table'[Type]),'Table'[Type])
 
 
Regards,
Harsh Nathani
 
 

Hi @Shaji ,

 

 

You can use SWITCH also

 

SWITCH(

TRUE(),

 

Table'[Event] = "AAA" && Table[Type] = "Cust123", "Customer",

Table'[Event] = "BBB" && Table[Type] = "Cust123", " Other Customer"

 

)

 

Regards

HN

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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