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
JensKlöker
Helper I
Helper I

DAX Filter Issue with Tables connected with relationships

Hello there,

 

Let's think about couples (1 male & 1 female) who are going to make sport together.

I have got two tables.

 

The first table contains "Timestamps" when the females did sport. Columns:

- Timestamp ID

- Female name

- Timestamp

 

The second table contains "Pairings" of the couples, with start time of the partnership and end time of the partnership. Columns:

- Pairing ID

- Female name

- Male name

- Start

- End (may be null which meens the partnership is still alive)

 

Now I want to create a column "Male name" in the first table.  At first the female Names have to match in both tables. Then the correct Male name should come out of the pairing for which the Timestamp from the first table is between Start and End of the pairing.

 

Every female and every male is only in one (or zero) parnerships at one time ;-). This meens that there will be timestamps for which the male name should be "null" because the female is not in a partnership for this timestamp.

 

I tried some things with

 

MailName =CALCULATE(   Pairings[MaleName];FILTER(...)

 

but since I'm quite new to Power BI and DAX I'm totally stuck.

May somebody help and give the rights hints, functions or formulas?

 

Best regards

JJ

2 REPLIES 2
Anonymous
Not applicable

Hello JayJay,

 

I found quite interesting what you're trying to do. Is it possible for you to share .pbix file? or at least some screenshots (if calculation works offcourse 🙂 )

 

Thanks,

TomMartens
Super User
Super User

Hey,
I have to admit, that I did not look at a data model that promised to reveal as much insights about the human nature than your data model, even if I guess I do not believe in all the underlying assumptions that I mean to discover in your model.


Nevertheless, the DAX, that's why we are here.

Create a calculated column in your female table (wish I had one, in one of numerous data models) like so

MaleName =
var femaleTimeStamp = 'femaleTable'[TimeStamp]
return
CALCULATE(
  FIRSTNONBLANK('maleTable'[MaleName],1)
    ,FILTER(ALL('maleTable')
    ,'maleTable'[Start] <= femaleTimeStamp &&
    'maleTable'[End] >= femaleTimeStamp
  )
)


Hope this gets you started (funny phrase)


Regards
Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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