Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 slicer
Role | Sort |
Role 1 | 1 |
Role 2 | 2 |
Role 3 | 3 |
I have a DimTechnicians table with a role field (for which they may have multiple)
Id | Name | Role |
1 | Person 1 | Role 1 |
2 | Person 2 | Role 2; Role 3 |
3 | Person 3 | Role 3 |
4 | Person 4 | Role 3; Role 1; Role 3 |
I then have a Fact table at the technician ID level on which I have based a table visual
Single select of the slicer works fine, multiple select doesn't
I have written this measure which I place on the table visual as a filter
Neither measure works
So for multiple slicer selection, using the example above, I would want to return technician id's who have Blade Tech 2 or Service Tech 4 in their Job Title
Any help would ba appreciated. Thanks
Solved! Go to Solution.
@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_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.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
25 | |
10 | |
7 | |
6 | |
6 |
User | Count |
---|---|
30 | |
11 | |
11 | |
10 | |
6 |