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

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

Reply
ppraveenk
Frequent Visitor

Add default values to Parameters in Navigation Table

Hello Experts, 

 

I am trying to add start and end dates parameters to a Navigation table with default values as today's date for a data connetor so that user can provide values while loading data. Can someone please provide pointers how to achieve this via M language. Following is what I managed to achieve so far. I get to see the startDate and endDate input fields where user can key in values. But couldn't manage to show default values in those input fields.

 

Also how do we pass a list of values to a parameter in Navigation table.

 

let
source = #table({"Name", "Data", "ItemKind", "ItemName", "IsLeaf"}, {
{ "UserSearch", (startDate as text, endDate as text)  => GetUserSearchTable(startDate, endDate), "Table", "Table", true }
{ "Users", GetUsersTable(), "Table", "Table", true }
}),
navTable = Table.ToNavigationTable(source, {"Name"}, "Name", "Data", "ItemKind", "ItemName", "IsLeaf")
in
navTable;

GetUserSearchTable = (startDate as text, endDate as text) as table =>
let
body = "{ ""endDate"" : """&endDate&""" , ""startDate"" : """&startDate&"""}",
source = Web.Contents("https://rest.api/users", [ RelativePath = "search", Content = Text.ToBinary(body)]),
json = Json.Document(source),
#"Converted to Table" = Record.ToTable(json),
Value = #"Converted to Table"{0}[Value],
#"Converted to Table1" = Table.FromList(Value, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table1", "Column1", {"userID"}, {"userID"}),
#"Renamed Columns" = Table.RenameColumns(#"Expanded Column1",{{"userID", "Id"}}),
#"Invoked Custom Function" = Table.AddColumn(#"Renamed Columns", "GetListTable", each GetListTable([Id])),
#"Expanded Users" = Table.ExpandTableColumn(#"Invoked Custom Function", "GetListTable", {"name", "type"}, {"name", "type"})
in
#"Expanded Users";

4 REPLIES 4
parry2k
Super User
Super User

@ppraveenk I don't think there is a way to set the default value of parameters to today's date.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k  thanks for your response. I've seen this possible in one of the connectors. PFB 

If not date, can we show some default text? How do we set anything as default value and pas the list to a prameter. I've gone through lot of forums but did not find any hints on this.

 

ppraveenk_0-1594709860963.png

 

I am looking for some inputs to set default vaulue in a text parameter field. Any pointers would be greatly helpful.

Hi @ppraveenk 

 

if you open your query in advanced editor, what does it look like

Cheers,
Sturla

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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