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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
LP280388
Resolver II
Resolver II

Datetime parameter giving error "Enter a DateTime value"

Hi Team, I m getting this error though im giving the right value. is there a way to fix this issue please. this is needed for implementing a Incremental refresh which needs these paramters in datetime type only.

 

LP280388_0-1733116693357.png

LP280388_1-1733116878871.png

 

 

5 REPLIES 5
danextian
Super User
Super User

Hi @LP280388 

 

Please see the screenshot below:

danextian_0-1733117416790.png

Here's the M code

#datetime(2024, 1, 1, 0, 0, 0) meta [IsParameterQuery=true, Type="DateTime", IsParameterQueryRequired=true]

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

@danextian

Hi Thanks for the response. For some reason its not working. I tried with multiple other formats too.

LP280388_2-1733118446658.png

 

 



#datetime(2024, 1, 1, 0, 0, 0) meta [IsParameterQuery=true, Type="DateTime", IsParameterQueryRequired=true]

  when I give the above M code as well it shows as follows. I see mins 00 is missing though. would that be the reason why its not able fetch the datetime format?

LP280388_1-1733118350325.png

 

#datetime(2024, 1, 1, 0, 0, 0)

YYYY, M, D, H, M, S - these time elements are required for the #datetime. You screenshot is missing the seconds. Also this M code looks fine to me

danextian_0-1733119048746.png

If you don't follow the required format, the M code will return a text instead of #datetime

danextian_1-1733119100536.png

I would suggest you copy the M code I gave and edit from there.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Yes I have been tring with the M code only. When I see in the output I see that the seconds are missing.  Any idea what could be wrong with this datatime format?

LP280388_0-1733122182197.png

 

Anonymous
Not applicable

Hi @LP280388 

This is quite a strange phenomenon. These operations work perfectly fine in my Power BI Desktop. If possible, you might want to try upgrading Power BI Desktop to the latest version to rule out whether this issue is caused by a version problem.

 

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors