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! Get ahead of the game and start preparing now! Learn more
Hi,
How can I find the total number of times a character occurs within a string.
It can be in DAX or M Query
For example I have a column which has values like
JJAAA, JAJAJ, JJJJJ ..etc
Now I want to find number of times character J is present in each string
JJAAA - 2
JAJAJ - 3
JJJJJ - 5
Thanks,
Mannu
Solved! Go to Solution.
Include a column and use the below formula:
NumberofJs = LEN(Table3[StringText])-LEN(SUBSTITUTE(Table3[StringText],"J",""))
Include a column and use the below formula:
NumberofJs = LEN(Table3[StringText])-LEN(SUBSTITUTE(Table3[StringText],"J",""))
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |