Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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] ) ) )
User | Count |
---|---|
12 | |
12 | |
8 | |
8 | |
6 |
User | Count |
---|---|
27 | |
19 | |
13 | |
11 | |
7 |