Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I'm trying to calculate the time between two date columns that are in different tables
This is what i got so far:
For example the time differens in the first record should juist a bit longer than 3 days and not -201,63
I also tried:
_AN_Houdbaarheid = DATEDIFF(RELATED(AQZ_SAMP_VIEW[MO_Bemonsteringsdatum].[Date]);'AQZ_TEST_VIEW'[AN_start_Datum].[Date];DAY)
But the same probleem. Hopefully someone can help my
Solved! Go to Solution.
Hi @icturion ,
By my tests, if you want to calculate the difference between the date from different table, you formula should be right.
I have a little confused about your scenario, for your first record, the difference between 2016-7-28 11:45:00 and 2016-1-8 20:31:00 should be 202 if you calculate for Days.
Why do you think that time differens in the first record should juist a bit longer than 3 days?
Did I misunderstand your data sample?
What is your desired output? And which difference do you want to calculate between the two date column? Day, Month or Minute?
Best Regards,
Cherry
Hey,
I guess the date is not recognized properly, just check using the month function, if you receive July or August and not error and January.
Do not use .Day, just the column reference.
Regards,
Tom
Hi Tom,
If i use:
Month check = AQZ_TEST_VIEW[AN_Start_Datum].[Month]
and
Month check = AQZ_SAMP_VIEW[MO_bemonsteringdatum].[Month]
I get the correct month on bove columns.
but still the time differents is incorrect
Hi @icturion ,
By my tests, if you want to calculate the difference between the date from different table, you formula should be right.
I have a little confused about your scenario, for your first record, the difference between 2016-7-28 11:45:00 and 2016-1-8 20:31:00 should be 202 if you calculate for Days.
Why do you think that time differens in the first record should juist a bit longer than 3 days?
Did I misunderstand your data sample?
What is your desired output? And which difference do you want to calculate between the two date column? Day, Month or Minute?
Best Regards,
Cherry
Hi Tom,
If I use month with datediff the i get an error.
both columns are type: date and time
Regards
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
72 | |
38 | |
31 | |
26 |
User | Count |
---|---|
97 | |
85 | |
43 | |
40 | |
35 |