Forum Discussion

NeilL's avatar
NeilL
Frequent Visitor
7 years ago
Solved

Need Help With DAX Filtering

Hello All, I am new to DAX and am stuck.  I don't quite understand the FILTER() function which is, I think, the reason I am stuck.   I have two tables, Dates & Forecast, which are joined on a fiel...
  • Anonymous's avatar
    Anonymous
    7 years ago

    NeilL -

    You could modify the calculation like the following:

     

    Running Total = 
    var maxForecastDateInContext = MAX(Forecast[Date])
    var lastDateInContext = MAX('Date'[Date])
    var lastRelevantDate = MIN(lastDateInContext, maxSalesDate)
    return CALCULATE(
        SUM('Forecast'[Revenue]),
        'Date'[Date] <= lastRelevantDate
    )

    Hope this Helps,

    Nathan