Forum Discussion
Filtering Based on a Measure Value Affecting a Table, but not a graph
So my data includes information on every employee in my company in my area (>600). I have a measure that calculates what I've been calling "Employee Career Specialty" (EmpSpec,) which is based on how long they've worked on specific types of projects through their career.
Then, in order to filter the table to show employees with a specific career specialty, I have a separate, unrelated table (Bldg Types (Ref)) with all specialty options, and a "Check" measure to make sure that the selected value from UT. The check measure (Called SpecCheck) reads like this:
if(
CONTAINSSTRING(
EmpSpec,
SELECTEDVALUE(
'Bldg Types (Ref)'[Building Type]
)
),
1,
0
)
I then apply a filter at the visual level such that Check = 1, and create a slicer using the column from Bldg Types (Ref). On a table, it fitlers correctly, only showing the names of those who have the chosen specialty.
In addition to the table listing out all the names, I also have a funnel chart that counts all the distinct employee IDs in the table, separated by the employees' internal level (1, 2, etc.). The problem is, the slicer doesn't affect the counts at all in the chart. I've even tried creating an entirely separate measure that does performs the count using the calculate function (see below), but still no luck. I unfortunately won't be able to share the source data due to its sensitive nature. Any help is greatly appreciated!
calculate(
DISTINCTCOUNT(
'Master Reference Data'[Employee ID]
),
Filter(
'Master Reference Data',
SpecCheck=1
)
)
Add the employee field to the filter pane for the funnel chart, select TopN in the dropdown, add first measure (If(CONTAINSTRING...)) to the filter and input 1 as the TopN
5 Replies
- AnonymousNot applicable
HI Anonymous,
The measure filter which happened on the visual level filter only works on the current visual, you can't extract the current filter effect from other visuals. If you want to get the filter effect, you also need to use the measure filter on other visuals.
Regards,
Xiaoxin Sheng
- AnonymousNot applicable
Thank you for your reply. I do have the measure fitler applied to the other visuals, but when the options are the slicer are selected, nothing happens.
The second bit of code I provided was an attempt to make another method work, but hasn't yielded any results either.
- PaulDBrown
Community Champion
Add the employee field to the filter pane for the funnel chart, select TopN in the dropdown, add first measure (If(CONTAINSTRING...)) to the filter and input 1 as the TopN
- AnonymousNot applicable
PaulDBrown so this method works if I use it on a card, but not the funnel chart. Since the funnel chart is broken up by internal employee level, I had already made sure to include Employee Level as a viable filter in the calculations of EmpSpec by including it in the AllExcept function (see below). The code in question calculates time spent on commercial building sites, but each building site calculation is essentially identical
VAR CommercialTime =
//Calculating time and percentages for each segment separately
calculate(
sum('Master Reference Data'[Days On Job]),
AllExcept(
'Master Reference Data',
'Master Reference Data'[Employee Name],
'Master Reference Data'[Building Type],
'Master Reference Data'[Job Tier Tracker.Job Tier],
'Master Reference Data'[Employee Level]
),
'Master Reference Data'[Building Type]="Commercial"
) - AnonymousNot applicable
Scratch my last reply, this worked! Thank you for your help!