Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Use measure as a filter in DAX

Hi,   I have a dax which should return a date. I want it to get filtered by a measure value. 68 in the dax needs to be replaced by a measure. The moment I put the measure there, it returns BLANK. ...
  • Greg_Deckler's avatar
    3 years ago

    Anonymous Try this and then you can more easily troubleshoot what is going wrong by returning the variables (use TOCSV for the table variables).

    Measure = 
      VAR __FilterMeasure = [FilterMeasure]
      VAR __Table = FILTER(ALL('MyTable'), [QTR_SEQ_NUMBER] = __FilterMeasure)
      VAR __Dates = DISTINCT(SELECTCOLUMNS(__Table, "__Date", [QTR_START_DATE]))
      VAR __Result = MAXX(__Dates, [__Date])
    RETURN
      __Result