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
LD1
Helper III
Helper III

if text contains DAX

Hi everyone, 

 

In my research i saw different formulas but none of them match with mine.

Here, you can see what I tri to figure it out : 

 

Measure = IF( CONTAINS('Origine de vente retraitée','Origine de vente retraitée'[Pole/Zone retraité],"ZONE"), "DCL",'Origine de vente retraitée'[Pole/Zone retraité] )
 
Data type : Text (?)
 
Please, can you help me to solve this issue ? 
Thank you so much in advance !
 
Have a good day
1 ACCEPTED SOLUTION
v-yaningy-msft
Community Support
Community Support

Hi, @LD1 

You can try the measure to solve the problem. If it doesn't work, you can check if the solution linked below meets your needs.

Measure:

 

Measure = IF(
    SEARCH("ZONE", 'Origine de vente retraitée'[Pole/Zone retraité], 1, BLANK()) <> BLANK(),
    "DCL",
    'Origine de vente retraitée'[Pole/Zone retraité]
)

 

Related link: Solved: DAX If field contains text - Microsoft Fabric Community 

 

If this does not work, could you please share some sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

2 REPLIES 2
v-yaningy-msft
Community Support
Community Support

Hi, @LD1 

You can try the measure to solve the problem. If it doesn't work, you can check if the solution linked below meets your needs.

Measure:

 

Measure = IF(
    SEARCH("ZONE", 'Origine de vente retraitée'[Pole/Zone retraité], 1, BLANK()) <> BLANK(),
    "DCL",
    'Origine de vente retraitée'[Pole/Zone retraité]
)

 

Related link: Solved: DAX If field contains text - Microsoft Fabric Community 

 

If this does not work, could you please share some sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

bhanu_gautam
Super User
Super User

@LD1 , Please try this one 

 

Measure =
IF (
CONTAINS (
VALUES ('Origine de vente retraitée'[Pole/Zone retraité]),
'Origine de vente retraitée'[Pole/Zone retraité],
"ZONE"
),
"DCL",
'Origine de vente retraitée'[Pole/Zone retraité]
)

 

Please accept as solution and give kudos if it helps





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.