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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Microsoft Employee
Microsoft 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
Microsoft Employee
Microsoft 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.