Forum Discussion
Martinj9
6 years agoFrequent Visitor
Creating a dynamic parameter - possibilities? Current date to week number
Hi, I was wondering if someone had any experiance with creating dynamic parameters? Currently trying to create a parameter that updates itself based on current date, for today I would for insta...
- 6 years ago
Hi - You can try something like below. This will create a Query with single value i.e. YYYYWW. You can then refer this query inside your Main Query for filter.
let Source = #table({"CurrDate"},{{DateTime.LocalNow()}}), Custom1 = Table.AddColumn(Source,"Week",each Text.From(Date.Year([CurrDate])) & Text.From(Date.WeekOfYear([CurrDate]))), Custom2 = Custom1{0}[Week] in Custom2Thanks
Ankit Jain
Do Mark it as solution if the response resolved your problem. Do Kudo the response if it seems good and helpful.
AnkitBI
6 years agoSolution Sage
Hi - You can try something like below. This will create a Query with single value i.e. YYYYWW. You can then refer this query inside your Main Query for filter.
let
Source = #table({"CurrDate"},{{DateTime.LocalNow()}}),
Custom1 = Table.AddColumn(Source,"Week",each Text.From(Date.Year([CurrDate])) & Text.From(Date.WeekOfYear([CurrDate]))),
Custom2 = Custom1{0}[Week]
in
Custom2Thanks
Ankit Jain
Do Mark it as solution if the response resolved your problem. Do Kudo the response if it seems good and helpful.
Martinj9
6 years agoFrequent Visitor
Hi Ankit,
Excellent. This worked perfectly. Thanks you!