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
Guys,
Please your help to write a DAX expression that gets a value from each row and count delimiters.
The delimiter can be ";", " " or ",".
Thanks in advance
Solved! Go to Solution.
Hi @joe100 .
Not sure about DAX, but you can do it in Power Query.
Just create a custom column using formula as below;
List.Count(Text.ToList(Text.Select([Column], ";")))
Let me know if it works.
Thanks,
Sanket.
If this post helps, then give it a 👍 and mark it as 'Accept as Solution'.
Just replace the ; from that formula with "," or " " as per your requirement.
If this post helps, then give it a 👍 and mark it as 'Accept as Solution'.
= List.Count(Text.PositionOfAny("abc,def shkd;22l3f oiw;d", {";"," ",","}, 2))
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
= List.Count(Text.PositionOfAny("abc,def shkd;22l3f oiw;d", {";"," ",","}, 2))
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
In my case it's:
List.Count(Text.PositionOfAny([ID], {";"," ",","}, 2)))Awesome! This works for me, many thanks.
Is there an option to add also "NewLine" delimiter?
Hi @joe100 .
Not sure about DAX, but you can do it in Power Query.
Just create a custom column using formula as below;
List.Count(Text.ToList(Text.Select([Column], ";")))
Let me know if it works.
Thanks,
Sanket.
If this post helps, then give it a 👍 and mark it as 'Accept as Solution'.
Thank you, it works!
How I extend it also for "," and " "?
Just replace the ; from that formula with "," or " " as per your requirement.
If this post helps, then give it a 👍 and mark it as 'Accept as Solution'.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 36 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 89 | |
| 73 | |
| 66 | |
| 65 |