Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I'm trying to solve a problem:
I have two tables, CSMs and Issues. The CSMs table has one column, CSM and it's text column which is a list of about 20 names.
The Issues table has a text column called CSM that contains the same names as the CSMs table, but sometimes there are multiple names in that column separated by commas.
I want to add a slicer to a page with its Field being 'CSMs'[CSM] but when a name is selected in the slicer, the Issues table is filtered not just by rows with that exact match in the CSM column but any row where the selected name exists in the CSM column.
I can't see that you can apply the in operator to a relationship between two tables, and if I split the 'Issues'[CSM] into rows on the comma it'll stuff up all my measures.
How can I solve this, I'm happy using Power Query or DAX.
Many thanks in advance.
Solved! Go to Solution.
I was able to get it to work for a single selection using the CONTAINSSTRING.
Measure =
VAR _Name = SELECTEDVALUE(names[Name])
RETURN IF(CONTAINSSTRING(SELECTEDVALUE(Issues[Name]),_Name),1)
Putting that measure as a fitler on the issues table set to Is Not Blank will filter to only the rows where the names list containst the selected name.
I have attached my sample file for you to look at.
I can't think of a way to do it where you could select more than one name. For that I though you would have to split the names on the issues so it could be joined to the employee table.
I was able to get it to work for a single selection using the CONTAINSSTRING.
Measure =
VAR _Name = SELECTEDVALUE(names[Name])
RETURN IF(CONTAINSSTRING(SELECTEDVALUE(Issues[Name]),_Name),1)
Putting that measure as a fitler on the issues table set to Is Not Blank will filter to only the rows where the names list containst the selected name.
I have attached my sample file for you to look at.
I can't think of a way to do it where you could select more than one name. For that I though you would have to split the names on the issues so it could be joined to the employee table.
@willpage , Better would be that you split into rows and handle duplication because of that in the calculation .
create an index column and then split.
The other way would be the get these names into a separate table and then split it there.
and the use containsstring , find and search in the formula when every you select some value in the slicer. No need to join this new table with split names with the main table back
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
98 | |
78 | |
64 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |