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
Tober1996
Helper I
Helper I

Measure for a new Column with if and contains

Hello, I like to create a new ColumnZ in my table with a measure. This measure should create the following value:

Check if ColumnX = empty

    Yes:  then check if ColumnY starts with "abc" ... If Yes: Write "1" to ColumnZ otherwise write "2" to ColumnZ

    No: Write text ColumnX to ColumnZ

 

I know, for professionals its an easy excel-if-function which is to be transferred, but I'm not a professional....

 

Thanks for help!

1 ACCEPTED SOLUTION
jppv20
Solution Sage
Solution Sage

Hi @Tober1996 ,

 

This should work:

ColumnZ = IF('Table'[ColumnX]<>BLANK(),'Table'[ColumnX],IF(LEFT('Table'[ColumnY],3)="abc",1,2))
 
Jori

View solution in original post

3 REPLIES 3
Tober1996
Helper I
Helper I

Thats perfect Jori!!!

Thanks a lot for the fastest help I ever got!

Tober

jppv20
Solution Sage
Solution Sage

@Tober1996 
If my reply helped, then please consider Accept it as the solution to help the other members find it more quickly.

jppv20
Solution Sage
Solution Sage

Hi @Tober1996 ,

 

This should work:

ColumnZ = IF('Table'[ColumnX]<>BLANK(),'Table'[ColumnX],IF(LEFT('Table'[ColumnY],3)="abc",1,2))
 
Jori

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.