Forum Discussion
Anonymous
3 years agoNot applicable
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. ...
- 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
Greg_Deckler
Community Champion
3 years agoAnonymous 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
Anonymous
3 years agoNot applicable
I was not putting the variables in the right way. This method worked. Thanks a lot Greg. Saved my day.