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

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.

Reply
Anonymous
Not applicable

Pass system date to parameter

hello,
how to pass system date to parameter ....

 

 

#date(2018, 4, 13) meta [IsParameterQuery=true, Type="Date", IsParameterQueryRequired=true]

 


regards

pooja Dhonde

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

You could create a Blank Query by DateTime.LocalNow() in Query Editor to get the system time.

 

Then you try to use this accessing data funtion below in the Advanced options when you get data from SQL Server Datebase.

 

Sql.Database(server as text, database as text,  [Query = "select A from table where..." & "localtime"]) as table

 

In Addition, you could have a good reference of DateTime.LocalNow() and Sql.Database.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Greg_Deckler
Super User
Super User

Is that a statement or a question?

 

DateTime.LocalNow will give you the "system time"


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hello,
That is question not statement ..

Can you explain more how to pass DateTime.LocalNow in advance editor for above query.

Actually my database is SQL and I want to pass system date that time that will fetch data from database and will show on dashboard. I have created parameter but can I pass system date to that parameter???and how??


Regards
Poojad1



Hi @Anonymous,

 

You could create a Blank Query by DateTime.LocalNow() in Query Editor to get the system time.

 

Then you try to use this accessing data funtion below in the Advanced options when you get data from SQL Server Datebase.

 

Sql.Database(server as text, database as text,  [Query = "select A from table where..." & "localtime"]) as table

 

In Addition, you could have a good reference of DateTime.LocalNow() and Sql.Database.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you..

Hi @Anonymous,

 

That' my pleasure.Smiley Wink

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

#date(2018, 4, 13) meta [IsParameterQuery=true, Type="Date", IsParameterQueryRequired=true]

hello,
how to pass system date to parameter ....

 


regards

pooja Dhonde

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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