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 need to count how many times a word appears in each cell. (are logs of an application)
Ex.:
Text
Doc A Saved, Doc B Error, Doc C Saved, Doc D Attention
I need to count how many times the word "saved" appears, in the example above 2 times.
Solved! Go to Solution.
Hi @Adalapc
try this
CountColumn = (len('Table'[Text])-len(substitute('Table'[Text];"Saved";"")))/len("Saved")
you canalso store your replaced word in the new column SavedText and change "Saved" in the formula on 'Table'[SavedText]
Hi @Adalapc ,
I modified @az38 's expression:
CountMeasure = SUMX ( 'Table', CALCULATE ( DIVIDE ( LEN ( MAX ( 'Table'[Text] ) ) - LEN ( SUBSTITUTE ( MAX ( 'Table'[Text] ), "Saved", "" ) ), LEN ( "Saved" ) ) ) )
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Adalapc
try this
CountColumn = (len('Table'[Text])-len(substitute('Table'[Text];"Saved";"")))/len("Saved")
you canalso store your replaced word in the new column SavedText and change "Saved" in the formula on 'Table'[SavedText]
Where do we put this?
CountColumn = (len('Table'[Text])-len(substitute('Table'[Text];"Saved";"")))/len("Saved")
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 |
---|---|
114 | |
100 | |
78 | |
75 | |
49 |
User | Count |
---|---|
145 | |
108 | |
107 | |
89 | |
61 |