Forum Discussion

Nisha357's avatar
Nisha357
New Member
1 year ago
Solved

Restrict output only for dates in dataset

User Status Measure = SWITCH(     TRUE(),     -- Mark as "Active" if conditions for activity are met     MAX(T[Date]) > CALCULATE(MIN(T[First Occurrence Date]), ALLEXCEPT(T, T[FN]))     && MA...
  • DAXian's avatar
    1 year ago
    You need to clarify your date conditions. 
     
    MAX(T[Date]) > CALCULATE(MIN(T[First Occurrence Date]), ALLEXCEPT(T, T[FN]))
        && MAX(T[Date]) >= DATE(2024, 10, 01),

    This filter will consider any record for as long as CALCULATE(MIN(T[First Occurrence Date]), ALLEXCEPT(T, T[FN])) is below or equal to MAX(T[Date]).
    foE example :
    MAX(T[Date])CALCULATE(MIN(T[First Occurrence Date]), ALLEXCEPT(T, T[FN]))DATE(2024, 10, 01)Satisfy first condition?Satisfy Second Condition?Is Active?
    April 1, 2025February 2, 2025October 1, 2024 YYY
    April 1, 2025April 12, 2025October 1, 2024 NYN
    April 1, 2025August 1, 2024October 1, 2024YYY
    April 1, 2025December 23, 1950October 1, 2024YYY

     

    If the above is correct, then we can focus on Inactive.

    MAX(T[Date]) >= DATE(2024, 10, 01) &&
        MAX(T[Date]) <= TODAY(),
    So as long as it is between Today and October 10, 2024 inclusive, it is inactive?
    This sets a confusion. Other records that should be inactive can be included in the active. Kindly provide more details for Inactive records.