Forum Discussion
Average difference date value is different in power BI
Hi there,
My sample data is present in this link: https://1drv.ms/x/s!AucycxZHFe9TjTF2d36VklLNs7UN?e=gOenxH . I am trying to calculate the average difference between the installationdate column present in the file and today(). Here is my code for calculating:
4 Replies
- mahoneypat
Microsoft Employee
Your 40 result looks correct to me in both PBI and Excel. What formula are you using in Excel?
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- Dunner2020
Post Prodigy
That's wired. I use the following approach.
First I create new column using following formula.
=DATEDIF(A2,TODAY(),"Y")
Then I calculate the average using Average() function to calculate the average value of new column.
- Ashish_Mathur
Super User
Hi,
In cell D2, enter this formula and copy down
=DATEDIF(A2,TODAY(),"y")
Now if you average this column, the result is 40. So your DAX formulas is returning the correct result.
Hope this helps.
- AnonymousNot applicable
Hi Dunner2020,
Did these reply help with your scenario?
If this is a case, you can accept the most suitable one as a solution to help other users who faced the same issue. If not, please feel free to post here with detailed information.How to Get Your Question Answered Quickly
Regards,Xiaoxin Sheng