Forum Discussion
Split Value
- 1 year ago
Hi user1112
Apologies for wasting your time by providing the incorrect formula. Perhaps this solution will help you:
1. Create a calculated table with just IDs and split values:
SplitRelationships = VAR SourceTable = SUMMARIZE(DataTable, DataTable[ID], DataTable[Tags]) RETURN ADDCOLUMNS( GENERATE( SourceTable, VAR ItemCount = PATHLENGTH(SUBSTITUTE([Tags], ",", "|")) RETURN GENERATESERIES(1, ItemCount, 1) ), "SplitValue", PATHITEM(SUBSTITUTE([Tags], ",", "|"), [Value], TEXT) )
2. Create relationships between this table and your dimension tables.
3. Use this table in visuals when you need to filter by split values.
If this post helps, then please don't forget to give a "Kudos" – I’d truly appreciate it!
Thank you.
Hi user1112
Try this:
SplitValues = VAR SelectedValue = SELECTEDVALUE(YourTable[ColumnToSplit]) VAR SplitArray = PATHITEMREPLACE(SUBSTITUTE(SelectedValue, ",", "|")) RETURN CONCATENATEX(SplitArray, PATHITEM(SplitArray, [Value]), ", ")
There is no
PATHITEMREPLACE
function in dax.
- Elena_Kalina1 year agoSolution Sage
Hi user1112
Apologies for wasting your time by providing the incorrect formula. Perhaps this solution will help you:
1. Create a calculated table with just IDs and split values:
SplitRelationships = VAR SourceTable = SUMMARIZE(DataTable, DataTable[ID], DataTable[Tags]) RETURN ADDCOLUMNS( GENERATE( SourceTable, VAR ItemCount = PATHLENGTH(SUBSTITUTE([Tags], ",", "|")) RETURN GENERATESERIES(1, ItemCount, 1) ), "SplitValue", PATHITEM(SUBSTITUTE([Tags], ",", "|"), [Value], TEXT) )
2. Create relationships between this table and your dimension tables.
3. Use this table in visuals when you need to filter by split values.
If this post helps, then please don't forget to give a "Kudos" – I’d truly appreciate it!
Thank you.
- user11121 year agoNew Member
I got the error: The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
- Elena_Kalina1 year agoSolution Sage
Did you create a table like I have in my recommendations or a measure?