Forum Discussion

sandeep_potturi's avatar
sandeep_potturi
Frequent Visitor
1 year ago
Solved

How to find the Average before a date??

Hi all,   so i have this table and all i want to do is find the average BEFORE 02/07/2025. A Hardcoded date to make things simple.   so in this example for MC 543, i want the average of the numbe...
  • rajendraongole1's avatar
    1 year ago

    Hi sandeep_potturi - can you please try the below logic and pass the 543 (static cutoff). 

     

    Average Before Cutoff =
    VAR CutoffDate = DATE(2025, 2, 7)
    RETURN
    AVERAGEX(
    FILTER(
    YourTable,
    YourTable[Date] < CutoffDate &&
    YourTable[MC] = 543
    ),
    YourTable[Value]
    )

     

    Hope this helps.