Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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] ) ) )
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
18 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
25 | |
10 | |
10 | |
9 | |
6 |