Forum Discussion
Richard_Halsall
1 year agoHelper IV
Multiple selection from slicer with multiple values in column
Hi all Struggling to write a correct DAX measure to return a value of 1 in the following scenario I have a disconnected table (Technician Roles) of unique job roles which is the data for the slic...
- 1 year ago
Richard_Halsall can try below measure. It will checks if the technician's role field contains any of the selected roles. If so, it returns 1, otherwise 0.
ToFilter = VAR SelectedRoles = CONCATENATEX(VALUES('Technician Roles'[Role]), 'Technician Roles'[Role], ";") VAR TechnicianRoles = DimTechnicians[Role] RETURN IF ( NOT(ISBLANK(TechnicianRoles)) && TechnicianRoles <> "", IF ( LEN(SelectedRoles) > 0 && COUNTROWS( FILTER( VALUES('Technician Roles'[Role]), CONTAINSSTRING(TechnicianRoles, 'Technician Roles'[Role]) ) ) > 0, 1, 0 ), 0 )If this don't work, kindly @me and upload a sample of the pbix file you are working with for easy debugging.
DallasBaba
1 year agoSkilled Sharer
Richard_Halsall can try below measure. It will checks if the technician's role field contains any of the selected roles. If so, it returns 1, otherwise 0.
ToFilter =
VAR SelectedRoles = CONCATENATEX(VALUES('Technician Roles'[Role]), 'Technician Roles'[Role], ";")
VAR TechnicianRoles = DimTechnicians[Role]
RETURN
IF (
NOT(ISBLANK(TechnicianRoles)) && TechnicianRoles <> "",
IF (
LEN(SelectedRoles) > 0 &&
COUNTROWS(
FILTER(
VALUES('Technician Roles'[Role]),
CONTAINSSTRING(TechnicianRoles, 'Technician Roles'[Role])
)
) > 0,
1,
0
),
0
)
If this don't work, kindly @me and upload a sample of the pbix file you are working with for easy debugging.
- Richard_Halsall1 year agoHelper IV
DallasBaba Many thanks worked a treat