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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Inezyv
Regular Visitor

How to make condition that 'contains' a number?

Hi,

 

Currently I am working on a project where I have to add multiple conditional colomns where:

If the status (for example) contains '4' then yes otherwise no.

 

The different statusses are: 

Inezyv_0-1655194234096.png

 

So for example:

If I have status '129' then no, because (129 = status '128' + status '1')

But If I have status 132 then yes, because (132 = status '128' + status '4')

 

In MySQLworkbench I solved this by using the 'where status & 4' statement, but now I need to know how to do this in DAX.

Does anyone know a solution? 😊

 

2 REPLIES 2
isabella
Microsoft Employee
Microsoft Employee

Hi @Inezyv 

You can use expression like this:

Column = if(MOD([Column1],4)=0,"yes","no")

 

 

isabella_0-1655447715712.png

 

 

Best Regards,

Community Support Team _Isabella

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hariharan_R
Solution Sage
Solution Sage

Hi

you can use CONTAINSSTRING dax function.

Result = IF(CONTAINSSTRING('Table (2)'[Status],"4"),"Yes","No")
Hariharan_R_0-1655197315031.png

Thanks

Hari

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.

Top Solution Authors
Top Kudoed Authors