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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
cottrera
Post Prodigy
Post Prodigy

DAX Help required

Hi

 

I have a model with two tables.  My first Table = tenant table which has a Tenant number, property number and a tenant start date.

The example below shows two different tenants living in one property at different times 

 

Tenant#Property#Tenancy start dateTenancy end  date
12377701/01/202002/03/2021
45677703/03/202101/08/2025

 

My second table contains all the repairs that have taken place in the propery.  I would like a DAX function that  determines if the repair logged date was within the teancy start and end date , in order to populate the new column on the repairs table  highlighted in red with the tenant number.  

Repairs#Property#Repair logged dateDAX = Tenant#
3001077728/03/2020123
3086177717/05/2020123
2908777718/05/2020123
5067377722/06/2020123
7836777728/07/2020123
4433177704/02/2021123
2054677711/02/2021123
9615277713/02/2021123
5145277721/02/2021123
6851977722/04/2021456
8378177708/01/2022456
1238577729/01/2022456
4323177726/08/2022456

 

thank you 

 

Richard

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@cottrera Maybe:

Tenant # Column =
  VAR __Property = [Property#
RETURN
  MAXX(FILTER('Tenant Table', [Property#] = __Property && [Repair logged date] >= [Tenancy start date] && [Repair logged date] <= [Tenancy end date]),[Tenant])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
cottrera
Post Prodigy
Post Prodigy

Hi Greg

 

thank you for your quick response the DAX function works fine 😀

Greg_Deckler
Community Champion
Community Champion

@cottrera Maybe:

Tenant # Column =
  VAR __Property = [Property#
RETURN
  MAXX(FILTER('Tenant Table', [Property#] = __Property && [Repair logged date] >= [Tenancy start date] && [Repair logged date] <= [Tenancy end date]),[Tenant])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.