Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
frankhofmans
Helper IV
Helper IV

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 certain consultation already happened in the past or if 2 identical consultations are planned for the future. For example:

 

Client IDDateConsultation name
11201-11-2020Intake
11703-11-2020Intake
11910-11-2020Intake
11215-11-2020Follow up consultation
11718-11-2020Reintegration consultation
13310-12-2020Follow up consultation
11912-12-2020Intake
13315-12-2020Follow up consultation
13318-12-2020Reintegration consultation

 

In the results i want the client ID's with the future consultations and a Yes/No if this consultation already happened or is double planned in the future, so:

 

Client IDConsultation nameDate plannedAlready happened in past?Double planned in future?
119Intake12-12-2020YesNo
133Follow up consultation15-12-2020NoYes

 

Can someone help me out with this questions,

 

Many thanks in advance,

 

Regards, 

 

Frank

 

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

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.

View solution in original post

1 REPLY 1
V-lianl-msft
Community Support
Community Support

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.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.