Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Within a Power BI Role's DAX filter expression, is it possible to pass a local DAX variable that has a delimited string of values to an IN clause i.e [ColumnName] in { "Event A", "Event B", "Event C" }. [ColumnName] is one of the columns of the underlying imported data.
The DAX code checks ok but the filter does not work. No data is returned giving the perception that the IN clause did not like the passed delimited string variable.
I used the patterns mentioned on this post https://community.powerbi.com/t5/Desktop/DAX-how-split-a-string-by-delimiter-into-a-list-or-array/m-... Definitely very helpful and learnt a few more DAX concepts.
My Code looks like this:
[ColumnName] in
{
var IncomingString = "Program Name 1; Program Name 2"
var StringAsPath = SUBSTITUTE (IncomingString , ";", "|" )
var NoOfValues = PATHLENGTH (StringAsPath )
var MyTable =
ADDCOLUMNS (
GENERATESERIES (1, NoOfValues
"ProgramName", PATHITEM (StringAsPath, ''[Value], TEXT)
)
RETURN
CONCATENATEX (MyTable, [ProgramName], ",")
}
If I hard code the PBI Role's DAX filter as [ColumnName] in {"Program Name 1, Program Name 2"} then it filters the data correctly.
Please let me know what I might be doing wrong or whether this is not even possible inside a Power BI Role's DAX expression. Thanks in advance
Solved! Go to Solution.
Hi @kv ,
how about you change this
CONCATENATEX (MyTable, [ProgramName], ",")
to this
SUMMARIZE(MyTable, [ProgramName])
and drop the curly brackets
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.
Hi @kv ,
how about you change this
CONCATENATEX (MyTable, [ProgramName], ",")
to this
SUMMARIZE(MyTable, [ProgramName])
and drop the curly brackets
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
9 | |
7 | |
7 | |
6 |
User | Count |
---|---|
20 | |
11 | |
10 | |
9 | |
7 |