Forum Discussion
How to use DateTime.FromFileTime
Hi,
how does above DAX formular work exactly? I already had a look at the official explanation on the Microsoft page. My assumption was that I could be able to add the creation time of an excel file that I uploaded to BI. That would help me a lot since I would like to display the actual time my data was created.
When I try to use it, I get an expression error although I did not mispell anything.
Thanks in advance
I'm not sure if i completely understand what you're trying to achieve.
The filetime is a Windows file time value, you can read more about it here:File Times
Is it the date time when the excel file was created or when the data was changed? if so you could follow the steps in the post below
Show date last saved for excel file source
7 Replies
- GordonliljSolution Sage
Hi,
DateTime.FromFileTime is not a DAX formula.
It's a M function used inside power query
- AnonymousNot applicable
Hi and thanks for the quick answer.
Does that mean that I can't use it within the query editor in Power BI?
Thanks
- GordonliljSolution Sage
Power query and query editor is the same thing so you can use it inside the query editor.
You wrote DAX so i understood it as you were trying to use the function inside a measure or calculated column. When creating calculated columns or measures you use DAX while inside the power query editor you use M.
Using it inside the power query editor you would need a file time value such as 129876402529842245 that the page gives as an example