Forum Discussion

Martinj9's avatar
Martinj9
Frequent Visitor
6 years ago
Solved

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...
  • AnkitBI's avatar
    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
        Custom2

    Thanks
    Ankit Jain
    Do Mark it as solution if the response resolved your problem. Do Kudo the response if it seems good and helpful.