Forum Discussion
dannytan1112
3 years agoHelper I
String Count with loop in each row
Hi Power BI master around the world, I have been so active recently because getting interested with this DAX. I have a very difficult measure that i am not sure if it is possible to do in Power B...
- 3 years ago
Hi dannytan1112
Please refer to attached sample file with the solutionCount = VAR CurrentElelent = SELECTEDVALUE ( Elements[Element] ) RETURN SUMX ( VALUES ( 'Table'[Column Name] ), VAR String = 'Table'[Column Name] VAR Items = SUBSTITUTE ( String, ", ", "|" ) VAR Length = PATHLENGTH ( Items ) VAR T1 = GENERATESERIES ( 1, Length, 1 ) VAR T2 = SELECTCOLUMNS ( T1, "@Item", PATHITEM ( Items, [Value] ) ) VAR T3 = FILTER ( T2, CONTAINSSTRING ( [@Item], CurrentElelent ) ) RETURN COUNTROWS ( T3 ) )
Mahesh0016
3 years agoSuper User
*If this post helps, please consider accept as solution to help other members find it more quickly and Appreciate your Kudos.