Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
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 ('ColumnB') derived from 'ColumnA' that isolates and returns only the words starting with "AAA", or even just contains "AAA".
Like:
"AAA-word1, AAA-word2, BBB-word3" -> "AAA-word1, AAA-word2"
I'm limited to performing this operation within Power BI (using DAX) as I don't have direct access to modify the source data.
Any insights, suggestions, or sample DAX code would be greatly appreciated!
Cheers
Hi,
you could try creating a calculated column to get everything before the first '-' then use that column in a slicer
Additionally, if due to the data source you're not able to use a calculated column it would also work as a measure:
Hi @Anonymous,
You can use the CONTAINSSTRING function to achieve this.
https://learn.microsoft.com/en-us/dax/containsstring-function-dax
Your code can be something like this:
Column B = IF( CONTAINSSTRING([Column A], "AAA"), [Column A] )
| User | Count |
|---|---|
| 53 | |
| 40 | |
| 35 | |
| 24 | |
| 22 |
| User | Count |
|---|---|
| 136 | |
| 111 | |
| 58 | |
| 43 | |
| 38 |