scpournara
New Member
- Joined
- Aug 24, 2014
- Messages
- 45
I wrote a fairly complex measure that is below. However, when I apply filter context, it does not work. Hoping someone can take a look and spot a suggestion?
Team Sales 2023A =
VAR MFG = SELECTEDVALUE(ColorClass[Color Classification])
VAR LEV =
SELECTEDVALUE ( 'Employee Mapping'[Position ID] )
VAR CAL =
CALCULATE (
SUM ( Sales1[Revenue] ),
ALL ( Sales1 ),
'Calendar1'[Year] = 2023,
PATHCONTAINS (
'Employee Mapping'[Path],
LEV
))
VAR MFG1 =
CALCULATE (
SUM ( Sales1[Revenue] ),
ALL ( Sales1 ),
'Calendar1'[Year] = 2023,
PATHCONTAINS (
'Employee Mapping'[Path],
LEV
),ColorClass[Color Classification]=MFG
)
VAR Sale =
CALCULATE (
SUM ( Sales1[Revenue] ),
'Calendar1'[Year] = 2023 )
VAR Fil = IF(ISFILTERED(ColorClass[Color Classification]),MFG1,CAL)
RETURN
IF (
Fil - Sale <= 0,
BLANK (),
Fil - Sale
)
Team Sales 2023A =
VAR MFG = SELECTEDVALUE(ColorClass[Color Classification])
VAR LEV =
SELECTEDVALUE ( 'Employee Mapping'[Position ID] )
VAR CAL =
CALCULATE (
SUM ( Sales1[Revenue] ),
ALL ( Sales1 ),
'Calendar1'[Year] = 2023,
PATHCONTAINS (
'Employee Mapping'[Path],
LEV
))
VAR MFG1 =
CALCULATE (
SUM ( Sales1[Revenue] ),
ALL ( Sales1 ),
'Calendar1'[Year] = 2023,
PATHCONTAINS (
'Employee Mapping'[Path],
LEV
),ColorClass[Color Classification]=MFG
)
VAR Sale =
CALCULATE (
SUM ( Sales1[Revenue] ),
'Calendar1'[Year] = 2023 )
VAR Fil = IF(ISFILTERED(ColorClass[Color Classification]),MFG1,CAL)
RETURN
IF (
Fil - Sale <= 0,
BLANK (),
Fil - Sale
)