Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi all
I am trying to make a new column that count the number of occurences contained in another columns strings
My data looks like this (the desired result is marked in yellow)
Thanks in advance
The Best Carsten
Solved! Go to Solution.
Hi,
Please check the below picture and the attached pbix file.
expected result CC =
VAR _maxnumber =
MAXX (
ADDCOLUMNS (
Data,
"@countdelimiter", LEN ( Data[Path] ) - LEN ( SUBSTITUTE ( Data[Path], "|", "" ) )
),
[@countdelimiter]
) + 1
VAR _generateseriestable =
SELECTCOLUMNS ( GENERATESERIES ( 1, _maxnumber, 1 ), "@number", [Value] )
VAR _t =
GENERATE (
_generateseriestable,
ADDCOLUMNS ( Data, "@item", PATHITEM ( Data[Path], [@number] ) )
)
RETURN
COUNTROWS ( FILTER ( _t, [@item] = EARLIER ( Data[ItemID] ) ) )
Thanks 🙂
Hi,
Please check the below picture and the attached pbix file.
expected result CC =
VAR _maxnumber =
MAXX (
ADDCOLUMNS (
Data,
"@countdelimiter", LEN ( Data[Path] ) - LEN ( SUBSTITUTE ( Data[Path], "|", "" ) )
),
[@countdelimiter]
) + 1
VAR _generateseriestable =
SELECTCOLUMNS ( GENERATESERIES ( 1, _maxnumber, 1 ), "@number", [Value] )
VAR _t =
GENERATE (
_generateseriestable,
ADDCOLUMNS ( Data, "@item", PATHITEM ( Data[Path], [@number] ) )
)
RETURN
COUNTROWS ( FILTER ( _t, [@item] = EARLIER ( Data[ItemID] ) ) )
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 4 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 13 | |
| 9 | |
| 9 | |
| 8 | |
| 7 |