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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
JimN
Frequent Visitor

How to dynamically set the Parameter Current Value?

Under Manage Parameter, when i use Suggested Values as Query, is there a way to set the Current Value to one of the item in the query result?

 

Example: if my query result is a list of dates, i would like to set the latest date as default and have my report use that when i first open the report.

1 ACCEPTED SOLUTION
ImkeF
Super User
Super User

As it looks, we cannot use dynamic values in parameters right now: https://community.powerbi.com/t5/Desktop/Options-to-have-report-parameters-similar-to-what-we-have-i...

 

So the option I see for you would be to add a column to your calendar-table where only for the current day, a fixed expression/value like "Today" will be returned. You could then "hardcode" that in your parameter.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

8 REPLIES 8
ryanbott
Frequent Visitor

@Anonymous , @Mmahachi 

 

I found a very helpful video by GuyInACube on Youtube about updating parameters via a REST call from PowerShell. 

 

https://www.youtube.com/watch?v=MJVSu47iMmo

Anonymous
Not applicable

Hello, resurrecting this one - I'm trying to do the same (fill in localnow as the current value by default, but can be overridden in Service if needed). Any new features that can allow this? Thanks in advance!

Anonymous
Not applicable

@JimN @ImkeF 

Appreciate assistance with the syntax.

I have my date table and added the current day column as a new column

isToday = IF('Date'[Date] = TODAY(), "TODAY", "")

How should I use it in the parameter management form?

Cheers!

This is a DAX formula that cannot reference parameters.

What exactly are you trying to accomplish?

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Anonymous
Not applicable

Hey @ImkeF 
I want to set the current/default value in a parameter to today.

2019-06-11 14_22_20-papercut - Remote Desktop Connection.png

 

Thanks!

did you get the solution for this - i'm trying to do the exact same thing. I put in the power query formulas for bringing back today's date but it's not extracting the date as the parameter, the parameter just shows the formula.

 

date.from(datetime.localnow())

Anonymous
Not applicable

@Mmahachi 

Unfortunately, I did not figure this out yet.

Let me know if you found a solution.

Cheers!
A

ImkeF
Super User
Super User

As it looks, we cannot use dynamic values in parameters right now: https://community.powerbi.com/t5/Desktop/Options-to-have-report-parameters-similar-to-what-we-have-i...

 

So the option I see for you would be to add a column to your calendar-table where only for the current day, a fixed expression/value like "Today" will be returned. You could then "hardcode" that in your parameter.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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