Forum Discussion
thinkvisual
7 years agoFrequent Visitor
Conditional formatting background colour for 'if text contains'
Hello! I need some help with coniditional formatting. I have checked through all other posts on the topic before I have posted this but think my query may be slightly different. I have a list of ...
- 7 years ago
Hi thinkvisual
You may have a look at FIND function.
Column = IF ( FIND ( "video", [URL], 1, -1 ) > 0, 1, // If find 'video',the column get 1 IF ( FIND ( "photo", [URL], 1, 0 ) > 0, 2, 3 ) ) // If find 'photo',get 2,otherwise get 3Regards,
thinkvisual
7 years agoFrequent Visitor
v-cherch-msft Wonderful thank you. I have started working with some DAX today and i'm learning. Would you be able to explain what the numbers are doing in your code so I can understand what is happening please?
Column =
IF (
FIND ( "video", [URL], 1, -1 ) > 0,
1,
IF ( FIND ( "photo", [URL], 1, 0 ) > 0, 2, 3 )
)
Thanks
David
v-cherch-msft
7 years agoMicrosoft Employee
Hi thinkvisual
You may have a look at FIND function.
Column =
IF (
FIND ( "video", [URL], 1, -1 ) > 0,
1, // If find 'video',the column get 1
IF ( FIND ( "photo", [URL], 1, 0 ) > 0, 2, 3 )
) // If find 'photo',get 2,otherwise get 3
Regards,
- thinkvisual7 years agoFrequent Visitor
Thank you so much for your help, much appreciated.
David
- v-cherch-msft7 years agoMicrosoft Employee