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 am trying to calculate the days difference between two dates e.g. create and resolved some tickets are not resolved hence the dates are blank so to handle that i created "Resolved 2" however i use this in the "Incident Age 2" formula its given me wierd result (see below) not sure why. For the dates which are not blank the result is correct. What am i doing wrong?
Solved! Go to Solution.
Note you can use DATEDIFF to return the result in hours or minutes too, and then divide by 24, etc. to get days in decimal form. You could also use your Resolved 2 expression in a variable and use that in your Age measure (instead of a separate measure).
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Note you can use DATEDIFF to return the result in hours or minutes too, and then divide by 24, etc. to get days in decimal form. You could also use your Resolved 2 expression in a variable and use that in your Age measure (instead of a separate measure).
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
@mahoneypat i just noticed a slight difference in the result , please see below. The result for the below example should 8.95 but with our calculation its coming up 8.96 what could be wrong ?
Looks like a rounding error. Maybe return MINUTES in the DATEDIFF instead?
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
@mahoneypat i returned it in SECONDS and then divided by /24/60/60 to convert it in days and it solved the issue.
@mahoneypat thanks for this, it was the simplest solution and it worked for me. Kudos to you.
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 |
---|---|
47 | |
24 | |
20 | |
15 | |
13 |
User | Count |
---|---|
51 | |
46 | |
39 | |
19 | |
19 |