Forum Discussion

AragakiSora's avatar
AragakiSora
Frequent Visitor
3 years ago
Solved

Create a cumulative count based on criteria

Hello!    I have a table similar to this: Name ID Last Update  Michelle   7/2/2023 Michelle 1000012 7/5/2023 Michelle 1000012 8/29/2023 Glory 1000014 7/2/2023 Glory   ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi AragakiSora ,

    Please check that this calculated column meets your requirements:

    Flag = 
    VAR CurrentName = 'Table'[Name]
    VAR CurrentDate = 'Table'[Last Update]
    VAR CurrentID = 'Table'[ID]
    VAR MinDateWithID = 
        CALCULATE(
            MIN('Table'[Last Update]),
            FILTER(
                'Table',
                'Table'[Name] = CurrentName &&
                NOT(ISBLANK('Table'[ID])) &&
                'Table'[Last Update] <= CurrentDate
            )
        )
    RETURN
        IF(
            ISBLANK(CurrentID) && MinDateWithID > DATEADD('Table'[Last Update], -7, DAY),
            1,
            0
        )

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum