Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi Team,
I have Markets and i need output in status column,
DAX - if markets contains 40* then H else W
Pleas
Thanks,
KV's
Solved! Go to Solution.
Hey @Anonymous ,
you should be able to solve that with a calculated column and the function CONTAINSSTRING:
Status = IF( CONTAINSSTRING( myTable[Markets], "40" ), "H", "W" )
Can you make this with multiple items for example by adding in || althouhg I get and error saying cannot convert value of type text to type true and false
Status = IF( CONTAINSSTRING( myTable[Markets], "40"||"50" ), "H", "W" )
Hey @Anonymous ,
you should be able to solve that with a calculated column and the function CONTAINSSTRING:
Status = IF( CONTAINSSTRING( myTable[Markets], "40" ), "H", "W" )
Hey @selimovd
Your response here really helped me, thank you!
I need to add an AND statement, but it's not working. Can you advise me please?
It would look something like this
IF (CONTAINS STRING (Table Y [Column], "A"), AND CONTAINS STRING (Table X [Column], "A"), "B", "C")
Thank you!
Hey @Carrhill ,
sure, you can combine them with the AND function:
Status =
IF (
AND (
CONTAINSSTRING ( 'Table Y'[Column], "A" ),
CONTAINSSTRING ( 'Table X'[Column], "A" )
),
"B",
"C"
)
Or you can combine them with two &&:
Status =
IF (
CONTAINSSTRING ( 'Table Y'[Column], "A" ) && CONTAINSSTRING ( 'Table X'[Column], "A" ),
"B",
"C"
)
Both should work the same way.
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
Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic
Hey @Anonymous ,
did it work with the calculated column I proposed?
I'm curious if you could solve this issue 🙂
User | Count |
---|---|
123 | |
76 | |
62 | |
50 | |
50 |
User | Count |
---|---|
175 | |
125 | |
60 | |
60 | |
58 |