Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have a table with a column "Indata" (type text). Each row consist of a set of comma separated "textelements".
For some of the rows the same textelement occurs more than once.
I would like to get help to find the DAX expression to filter out the copies.
Solved! Go to Solution.
@JorgenMaass Correct, that was the intention!! Here is the fully script:
Result Column =
VAR __Text = SUBSTITUTE([Indata],", ","|")
VAR __Count = PATHLENGTH(__Text)
VAR __Table =
DISTINCT(
SELECTCOLUMNS(
ADDCOLUMNS(
GENERATESERIES(1,__Count,1),
"__Word",PATHITEM(__Text,[Value])
),
"__Word",[__Word]
)
)
RETURN
CONCATENATEX(__Table,[__Word],", ")
@JorgenMaass Here's one way:
Result Column =
VAR __Text = SUBSTITUTE([Indata],", ","|")
VAR __Count = PATHLENGTH(__Text)
VAR __Table =
DISTINCT(
SELECTCOLUMNS(
ADDCOLUMNS(
GENERATE(1,__Count,1),
"__Word",PATHITEM(__Table,[Value])
),
"__Word",[__Word]
)
)
RETURN
CONCATENATEX(__Table,[__Word],", ")
@JorgenMaass Whoops, used the wrong variable. Can't believe that was the only issue, I winged it.
Result Column =
VAR __Text = SUBSTITUTE([Indata],", ","|")
VAR __Count = PATHLENGTH(__Text)
VAR __Table =
DISTINCT(
SELECTCOLUMNS(
ADDCOLUMNS(
GENERATE(1,__Count,1),
"__Word",PATHITEM(__Text,[Value])
),
"__Word",[__Word]
)
)
RETURN
CONCATENATEX(__Table,[__Word],", ")
@Greg_Deckler Thx again. Still dont get it to work.
2 errors:
* [Value] is an unknown variable
* GENERATE(1, Parameter is incorrent type
Best regards
@JorgenMaass Correct, that was the intention!! Here is the fully script:
Result Column =
VAR __Text = SUBSTITUTE([Indata],", ","|")
VAR __Count = PATHLENGTH(__Text)
VAR __Table =
DISTINCT(
SELECTCOLUMNS(
ADDCOLUMNS(
GENERATESERIES(1,__Count,1),
"__Word",PATHITEM(__Text,[Value])
),
"__Word",[__Word]
)
)
RETURN
CONCATENATEX(__Table,[__Word],", ")
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.