cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mmaria Visitor
Visitor

Set parameter = DateTime.LocalNow()

Hello! 

 

Is there any way to set a parameter as a function? I want to set a parameter as today like this: DateTime.LocalNow().

As a default I want it to be today's date but I also want to be able to set the date manually if I want to see data from a certain date in my dashboards.

 

Thank you!

 

5 REPLIES 5
BhaveshPatel Super Contributor
Super Contributor

Re: Set parameter = DateTime.LocalNow()

That is currently not possible. Parameters only allow values with List of Values, Any Values or other Query as the suggested values. if you have only one value that is defined using DateTime.LocalNow() then you can use that value as a suggested values using Query Option in the parameters dialog box. However, You can use the list of values as the suggested values where you have to manually select the today's date to pass the parameter's value. It is not dynamic but with the parameters in the baby stage, it would be more convenient option.

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.
donaldm Regular Visitor
Regular Visitor

Re: Set parameter = DateTime.LocalNow()

Want to revive this thread... is this still possible in the latest PowerBI version?

Mmahachi Regular Visitor
Regular Visitor

Re: Set parameter = DateTime.LocalNow()

I'm trying to do this now as well. I think it must be possible

fenixen Regular Visitor
Regular Visitor

Re: Set parameter = DateTime.LocalNow()

Trying to figure out the same issue... 

Highlighted
franck_axires Frequent Visitor
Frequent Visitor

Re: Set parameter = DateTime.LocalNow()

Hi you all M Gurus out there...

Has anyone managed to pass a DateTime.LocalNow() value as a parameter default ?

I'm trying it right now with the latest version of PBI Desktop but it seems the value is still interpreted as a String in the parameter editor.

Any clues ?

Best,

Franck

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 59 members 1,138 guests
Please welcome our newest community members: