Forum Discussion
Measure with Filter and Slicer
Hi FrageFrosch7 - issue due to measure it is handling the calculation when multiple months are selected.
we can modify the approach to calculate the most recent month in the slicer and then filter only on that month
Modified one:
Employeecount per team with FTE V2 =
VAR SearchText = SELECTEDVALUE(dim_employee[Team])
-- Get the selected team
VAR MaxMonth =
MAXX(
ALLSELECTED(dim_date[Monthshort]),
dim_date[Monthshort]
)
-- Get the most recent month selected from the slicer
RETURN
CALCULATE(
COUNTROWS(dim_employee),
dim_employee[Team] = SearchText,
FILTER(
dim_employee,
COUNTROWS(
FILTER(
fact_absence,
fact_absence[FTE] = 1 && -- Only count employees with FTE of 1
fact_absence[userkey] = dim_employee[itemkey] &&
dim_date[Monthshort] = MaxMonth -- Only consider the most recent month
)
) > 0
)
)
Hope this works , please check
Hi rajendraongole1,
I get the logic but unfortunately if I apply your solution I get this error
I tested the variable in a card visual that works fine. If i select in my slicer Jan, Feb, Jul it displays Jul.
I appreciate your help!