Forum Discussion
Anonymous
2 years agoNot applicable
Filtering words using strartwith with DAX
Hello Everyone, I have a column ('ColumnA') containing a string in the format "AAA-word1, AAA-word2, BBB-word3", with varying numbers of words in each entry. My goal is to create a new column ('C...
DOLEARY85
2 years agoResident Rockstar
Hi,
you could try creating a calculated column to get everything before the first '-' then use that column in a slicer
Column = LEFT('Table'[Word], FIND("-", 'Table'[Word]) - 1)
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
DOLEARY85
2 years agoResident Rockstar
Additionally, if due to the data source you're not able to use a calculated column it would also work as a measure:
Measure = LEFT(
CALCULATE(
MAX('Table'[Word]),
FILTER('Table', FIND("-", 'Table'[Word]) > 0)
),
FIND("-", CALCULATE(MAX('Table'[Word]), FILTER('Table', FIND("-", 'Table'[Word]) > 0)))-1
)
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍