Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all,
I'd like to link 2 tables on dates with a "between" relation.
I have a "ContractDate" in table 1 and a "ValidDateFrom" and "ValidDateTo" in table 2.
My goal is to create a relation like that :
1.ContractDate BETWEEN 2.ValidDateFrom AND 2.ValidDateTo
Is there a way to do that?
Thank you in advance.
Solved! Go to Solution.
@Tybaal
There is no such between relationship in power bi, you can just link either the fromdate and todate with the ContractDate in manage relationship, and set the conditions with dax in later calculation.
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Tybaal , try like
calculate(countrows(Table1), filter(Table,table1[ContractDate] >= min(table2[ValidDateFrom] && table1[ContractDate] >=table2[ValidDateTo])), values(Table[contract_id]))
or
calculate(countx(values(Table[contract_id]), Table[contract_id]), filter(Table,table1[ContractDate] >= min(table2[ValidDateFrom] && table1[ContractDate] >=table2[ValidDateTo])))
Thank you @amitchandak,
My issue is that I have no ID to link both tables... I only have the dates...
@Tybaal
There is no such between relationship in power bi, you can just link either the fromdate and todate with the ContractDate in manage relationship, and set the conditions with dax in later calculation.
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |