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
jibran
Helper II
Helper II

Custom column filter with user values

Hi,

I am struggling to write a simple dax where I want to create a calculated column on the basis of database column

like I have a table 

ID      Product                Calculated Column

1        Iphone 3              iphone

2        Iphone 4              iphone

3        Samsung s6         android

4        Samsung s5         android

 

I want to create dax query in calculated column whereever there is iphone3, iphone4 calculated column shows iphone and where there is samsung s6 and samsung s5 it shows android

 

Many Thanks 

 

Jibran Ishtiaq

1 ACCEPTED SOLUTION
v-haibl-msft
Employee
Employee

@jibran

 

Please try with following DAX expression.

 

Calculated Column = 
IF (
    SEARCH ( "Iphone", Table1[Product],, 0 ) > 0,
    "iphone",
    IF ( SEARCH ( "Samsung", Table1[Product],, 0 ) > 0, "android" )
)

Custom column filter with user values_1.jpg

 

Best Regards,

Herbert

View solution in original post

1 REPLY 1
v-haibl-msft
Employee
Employee

@jibran

 

Please try with following DAX expression.

 

Calculated Column = 
IF (
    SEARCH ( "Iphone", Table1[Product],, 0 ) > 0,
    "iphone",
    IF ( SEARCH ( "Samsung", Table1[Product],, 0 ) > 0, "android" )
)

Custom column filter with user values_1.jpg

 

Best Regards,

Herbert

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.

Top Solution Authors