Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

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

1 ACCEPTED SOLUTION

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

 

View solution in original post

7 REPLIES 7
Gordonlilj
Solution Sage
Solution Sage

Hi,

 

DateTime.FromFileTime is not a DAX formula.

It's a M function used inside power query

DateTime.FromFileTime 

Anonymous
Not 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

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

 

 

 

Anonymous
Not applicable

Thanks again, where do I get that file time from?

 

Does this refer to the database I chose, in my example it is an excel file.

 

Thank you

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

 

Anonymous
Not applicable

Many thanks again.

 

"Folder.Contents" is solving my issue 🙂 Exactly what I was looking for.

 

THX

Anonymous
Not applicable

It is the time that the excel file was created (last changed). Thanks for the links in your last post. I will check on those now.

 

Marc

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors