Forum Discussion

GunnerJ's avatar
GunnerJ
Icon for Post Patron rankPost Patron
4 years ago
Solved

repeat row value for new column based on filter date

I have a row counter for each row by account. What I'm hoping to do is repeat the max value across all rows as long as that rows date field is less than the date filter. The filter is in the "before"...
  • daniel79's avatar
    daniel79
    4 years ago

    This works in your pbix file.

     

    MAX ROW = VAR vMAXDATE = MAX('Date Table'[Date])
    RETURN CALCULATE(
        CALCULATE(
            MAX('MASTER CHARGE ACTIONS'[ROWRANK]),
            FILTER('MASTER CHARGE ACTIONS', 'MASTER CHARGE ACTIONS'[CHG_DATE] <= vMAXDATE)
        ),
        ALLEXCEPT('MASTER CHARGE ACTIONS','MASTER CHARGE ACTIONS'[BI_ACCT]))