Trying to return the maximum value of a filtered date column in Power BI

Alex Kitson picture Alex Kitson · Feb 5, 2019 · Viewed 9.5k times · Source

I have a table within Power BI that has a date field, and a value field. I am filtering on this date field, using a slicer, to sum all of the value data before the specified date. I would like to get this date value to use in a LOOKUPVALUE() elsewhere (to get a conversion rate).

Is there a way to accomplish this?

I have tried the DAX functions that return the values of a particular table/column with filters preserved but this never seems to work, and just returns the entire dataset, e.g. VALUES(), FILTERS(), ALLEXCEPT().

Any help would be greatly appreciated!

Answer

Alex Kitson picture Alex Kitson · Feb 8, 2019

I found a solution using measures.

The DAX for future reference:

Filter Date = CALCULATE(MAX('Table'[Date]),ALLSELECTED('Table'))