This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA 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.
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 date | Tenancy end date |
| 123 | 777 | 01/01/2020 | 02/03/2021 |
| 456 | 777 | 03/03/2021 | 01/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 date | DAX = Tenant# |
| 30010 | 777 | 28/03/2020 | 123 |
| 30861 | 777 | 17/05/2020 | 123 |
| 29087 | 777 | 18/05/2020 | 123 |
| 50673 | 777 | 22/06/2020 | 123 |
| 78367 | 777 | 28/07/2020 | 123 |
| 44331 | 777 | 04/02/2021 | 123 |
| 20546 | 777 | 11/02/2021 | 123 |
| 96152 | 777 | 13/02/2021 | 123 |
| 51452 | 777 | 21/02/2021 | 123 |
| 68519 | 777 | 22/04/2021 | 456 |
| 83781 | 777 | 08/01/2022 | 456 |
| 12385 | 777 | 29/01/2022 | 456 |
| 43231 | 777 | 26/08/2022 | 456 |
thank you
Richard
Solved! Go to Solution.
@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])
Hi Greg
thank you for your quick response the DAX function works fine 😀
@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])
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 29 | |
| 25 | |
| 25 | |
| 21 | |
| 14 |
| User | Count |
|---|---|
| 59 | |
| 50 | |
| 25 | |
| 20 | |
| 20 |