Forum Discussion

frankhofmans's avatar
frankhofmans
Icon for Helper IV rankHelper IV
5 years ago
Solved

Link future en historic actions

hi all,   i have the following question:   i have a database with planned consultations with corporate physicians. I want to show the future consultations in a table, but i want a alert if a cert...
  • V-lianl-msft's avatar
    5 years ago

    Hi frankhofmans ,

     

    There's no doubt that you need to create a rank column or measure to determine if the name has ever appeared before.

    Column =
    RANKX (
        FILTER (
            'Table',
            EARLIER ( 'Table'[Client ID] ) = 'Table'[Client ID]
                && EARLIER ( 'Table'[Consultation name] ) = 'Table'[Consultation name]
        ),
        'Table'[Date],
        ,
        ASC,
        SKIP
    )
    "Already happened in past?"	"Double planned in future?"

    I don't know what the calculation logic is in these two columns. According to my understanding, I created the following measure. You can rewrite this measure according to your own logic.

    Already happened in past =
    VAR max_col =
        CALCULATE (
            MAX ( 'Table'[Column] ),
            FILTER (
                ALLEXCEPT ( 'Table', 'Table'[Client ID], 'Table'[Consultation name] ),
                'Table'[Column] > 1
            )
        )
    RETURN
        IF ( max_col = MAX ( 'Table'[Column] ), "YES" )

    Sample .pbix

     

    Best Regards,
    Liang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.