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
dudu55
Frequent Visitor

new mesure if column X starts with XXX and column B is empty then new mesure is queal to columns X

Im trying to write new mesure but trully have no idea how to do it , it should be like that :

 

new mesure = if column X starts with XXX and column B is empty then new mesure is queal to columns X if columnY is queal to YYY  new mesure is equal to YYY

 

how can i write this in new mesure? help!

1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @dudu55 ,

 

I guess you want that as a calculated column.

If it's as a column that should work:

new mesure column =
SWITCH(
    TRUE(),
    LEFT( myTable[column X], 3 ) = 'XXX' && myTable[column B] = BLANK(), myTable[columns X],
    myTable[column Y] = 'YYY', 'YYY'
)

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

 

View solution in original post

3 REPLIES 3
selimovd
Super User
Super User

Hey @dudu55 ,

 

I guess you want that as a calculated column.

If it's as a column that should work:

new mesure column =
SWITCH(
    TRUE(),
    LEFT( myTable[column X], 3 ) = 'XXX' && myTable[column B] = BLANK(), myTable[columns X],
    myTable[column Y] = 'YYY', 'YYY'
)

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

 

Hey @dudu55 ,

 

did my calculated column give you the result you wanted?

I'm curious if you could solve this issue 🙂

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 
ryan_mayu
Super User
Super User

@dudu55 

maybe you need to create a column not a measure?

could you pls provide some sample data and expected output?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.