Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Filters on DAX measure problem

Dear community, hopefully someone knows how to fix this seemingly simple issue that I can't figure out how to solve myself.  I am creating measures that count the amount of employees that fit a cert...
  • Anonymous's avatar
    Anonymous
    3 years ago

    I found a workaround and now it works.  
    the old formula is 

    NoPromotionGradeEntryDate =
    CALCULATE(DISTINCTCOUNT('main data'[Person Number]);
    'main data'[Promoted] = 0;
     'main data'[Grade Entry Date] < 04-01-2011) 
     
    I changed this to the new formula using DATE as a variable:
    NoPromotionGradeEntryDate =
    VAR _date = DATE(2011; 04; 01)

    VAR _result = CALCULATE(DISTINCTCOUNT('main data'[Person Number]);
    'main data'[Promoted] = 0;
     'main data'[Grade Entry Date] < _date)
    RETURN _result
     
    Hope this helps others with the same problem!