Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all,
I am trying to find the number of names in a column and not the actual characters.
eg
John Doe = 2
John Doe = 7
Is there dax for a word in a text count and not only characters?
TIA
In case it helps, it is also possible to do this in query with M code too. For example,
List.Count(Text.Split("John Doe", " ")) would equal 2. You would use your column name in place of "John Doe".
If this works for you, please mark it as solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
So, potentially, this is the way I do these kinds of things:
Words Column Counter =
VAR __Length = LEN('Table'[Column])
VAR __Text = SUBSTITUTE('Table'," ","")
RETURN
__Length - LEN(__Text)
Hi @Greg_Deckler I seem to get an error with the following message:
The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
@Dee My bad, I corrected it below. Also included measure form.
Words Column Counter =
VAR __Length = LEN('Table'[Column])
VAR __Text = SUBSTITUTE('Table'[Column]," ","")
RETURN
__Length - LEN(__Text)
Words Column Measure =
VAR __Length = LEN(MAX('Table'[Column]))
VAR __Text = SUBSTITUTE(MAX('Table'[Column])," ","")
RETURN
__Length - LEN(__Text)
@Dee ,
Please watch the below video by @ruthpozuelo .
It separates your name into two separate column using DAX.
In your case you can just count the no. of space between words to get the total words.
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
84 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |