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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Self Referenzing Table with Non-Unique ID and Date Field

Hello Folks

 

I have a Table similar to this:

CallIDDateTimeCallParty
12021-01-01 10:00:23\
12021-01-01 10:00:25\
12021-01-01 10:00:28Wagner
22021-01-01 11:01:00\
22021-01-01 11:01:05Muller

 

So each Call get's an ID an i need to know who got the final Call with the same CallID which is the last with same CallID in the Order of DateTime.

 

So i would like to get 

CallIDFirstAttempDateTimeFinalDateTimeFirstCallPartyFinalCallParty
12021-01-01 10:00:232021-01-01 10:00:28\Wagner
22021-01-01 11:01:002021-01-01 11:01:05\Muller

 

Any Help is appreciatet!

 

Regards

Laurent

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Don'@laurentwagner,

You can create 4 measures as follows:

FirstAttempDateTime = 
CALCULATE (
    MIN ( 'Call'[DateTime] ),
    FILTER ( ALL ( 'Call' ), 'Call'[CallID] = MAX ( 'Call'[CallID] ) )
)
FinalDateTime = 
CALCULATE (
    MAX ( 'Call'[DateTime] ),
    FILTER ( ALL ( 'Call' ), 'Call'[CallID] = MAX ( 'Call'[CallID] ) )
)
FirstCallParty = 
MINX (
    FILTER ( 'Call', 'Call'[DateTime] = [FirstAttempDateTime] ),
    'Call'[CallParty]
)
FinalCallParty = 
MINX (
    FILTER ( 'Call', 'Call'[DateTime] = [FinalDateTime] ),
    'Call'[CallParty]
)

Self Referenzing Table with Non-Unique ID and Date Field.JPG's Looks

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Don'@laurentwagner,

You can create 4 measures as follows:

FirstAttempDateTime = 
CALCULATE (
    MIN ( 'Call'[DateTime] ),
    FILTER ( ALL ( 'Call' ), 'Call'[CallID] = MAX ( 'Call'[CallID] ) )
)
FinalDateTime = 
CALCULATE (
    MAX ( 'Call'[DateTime] ),
    FILTER ( ALL ( 'Call' ), 'Call'[CallID] = MAX ( 'Call'[CallID] ) )
)
FirstCallParty = 
MINX (
    FILTER ( 'Call', 'Call'[DateTime] = [FirstAttempDateTime] ),
    'Call'[CallParty]
)
FinalCallParty = 
MINX (
    FILTER ( 'Call', 'Call'[DateTime] = [FinalDateTime] ),
    'Call'[CallParty]
)

Self Referenzing Table with Non-Unique ID and Date Field.JPG's Looks

amitchandak
Super User
Super User

@Anonymous , Try measures like

 

FirstCallParty= firstnonblankvalue(Table[DateTime], max(Table[CallParty]))
FinalCallParty =lastnonblankvalue(Table[DateTime], max(Table[CallParty]))

 

or


FirstCallParty= calculate(firstnonblankvalue(Table[DateTime], max(Table[CallParty])), allexcept(Table, Table[CallID]))
FinalCallParty =calculate(lastnonblankvalue(Table[DateTime], max(Table[CallParty])), allexcept(Table, Table[CallID]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors