Forum Discussion
MouserMike
7 years agoHelper I
Add OR to a Measure
I created a slicer along with a custom measure to allow me to filter a visual based on whether a particular field contained the value selected in the slicer. Below is the formual for the measure: Im...
- Anonymous7 years ago
Try something like this:
Your Measure = var a = FIND(SELECTEDVALUE('DepartmentStakeholders'[Department]),SELECTEDVALUE('Projects'[PrimaryDepartment]),1,0) var b = FIND(SELECTEDVALUE('DepartmentStakeholders'[Department]),SELECTEDVALUE('Projects'[ImpactedDepartments]),1,0) return MIN(MAX(a,b),1)Hope this helps,
Nathan
MouserMike
7 years agoHelper I
littlemojopuppy
7 years agoCommunity Champion
Lose the double ampersand and replace with a comma
- MouserMike7 years agoHelper I
That removed the error, but now nothing is being returned when clicking a department in the slicer; results are always empty.
- littlemojopuppy7 years agoCommunity Champion
So I was never quite sure where you wanted the OR placed or if I had the field name correct. The syntax should work and you should be very close...
- MouserMike7 years agoHelper I
The fieldnames are correct.
The "OR" should be between 'Projects'[PrimaryDepartment] and 'Projects'[ImpactedDepartments]). If either of those fields contain the
SELECTEDVALUE ('DepartmentStakeholders'[Department], the result of the FIND should be True.