Forum Discussion
Use FILTER with CONTAINS
The column in my table follows this structure:
| Time |
| ["morning";"afternoon"] |
| ["morning"] |
| ["night"] |
| ["night";"afternoon"] |
I want to create a measure that counts the number of rows that contains the string "morning". Based on the example column above, the measure should return 2.
I've created the measure:
but is showing me a "in blank" result.
Anonymous try this
_measure = CALCULATE ( COUNTROWS( Taable ), CONTAINSSTRING(MyTable[Time],"morning"))I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
2 Replies
- parry2kSuper User
Anonymous try this
_measure = CALCULATE ( COUNTROWS( Taable ), CONTAINSSTRING(MyTable[Time],"morning"))I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
- amitchandakSuper User
Anonymous , see if one of the three can help
https://docs.microsoft.com/en-us/dax/containsstring-function-dax