Forum Discussion
Days difference between unrelated tables
- Anonymous2 years ago
Hi chonchar ,
Thank you for Ashish_Mathur answer.
Below is my table1:
Below is my table2:
Below is my table3:
The following DAX might work for you:
Days Difference1 = VAR DateFromTable1 = CALCULATE(MINX('Table1',Table1[approved date]), RELATEDTABLE('Table')) VAR DateFromTable2 = CALCULATE(MAX(Table2[Creation date]), RELATEDTABLE('Table')) RETURN DATEDIFF(DateFromTable1, DateFromTable2, DAY)The final output is shown in the following figure:
The reason for the incorrect values is mainly because the relationships are not known how they are paired, please send your relationship pairing chart in detail as the correct pairing of the relationships can make a big difference in the results.
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi chonchar ,
Thank you for Ashish_Mathur answer.
Below is my table1:
Below is my table2:
Below is my table3:
The following DAX might work for you:
Days Difference1 =
VAR DateFromTable1 = CALCULATE(MINX('Table1',Table1[approved date]), RELATEDTABLE('Table'))
VAR DateFromTable2 = CALCULATE(MAX(Table2[Creation date]), RELATEDTABLE('Table'))
RETURN
DATEDIFF(DateFromTable1, DateFromTable2, DAY)
The final output is shown in the following figure:
The reason for the incorrect values is mainly because the relationships are not known how they are paired, please send your relationship pairing chart in detail as the correct pairing of the relationships can make a big difference in the results.
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous this works perfectly. Thank you very much.