Forum Discussion

DryMouse555's avatar
DryMouse555
Frequent Visitor
2 years ago

Enter Date filter in Power BI Source url

Hi,

 

I have a source API URL:
= Json.Document(Web.Contents("https://xyz.com.au/api/",
[Query=[
dbtable="statementitems",
fundingtype= "2",
Authkey = ApiKey,
includedeleted = "yes",
toprestrict = "1000000",
source= "powerBI"
]]
))

 

The result gives me only one Month related data. But, I am after all the months as per the dbtable. I am expecting the same data as it was in dbtable.

I was informed that the dates where defaulted so I am only getting 1 month data.

How can I add a filter in the query where I can get all months data.

The date column name in dbtable is "itemdate"
I want to write someting like between, itemdate= "1/Jun/2024" & itemdate= "1/Jun/2026"

 

Please tell me how to do that.

 

Thanks

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi DryMouse555 ,

    Please update the codes as below and check if it can return the expected data with specific date range:

    let
        Source = Json.Document(Web.Contents("https://xyz.com.au/api/", 
        [
            Query = [
                dbtable = "statementitems",
                fundingtype = "2",
                Authkey = ApiKey,
                includedeleted = "yes",
                toprestrict = "1000000",
                source = "powerBI"
            ]
        ])),
        FilteredData = Table.SelectRows(Source, each [itemdate] >= #date(2024, 6, 1) and [itemdate] <= #date(2026, 6, 1))
    in
        FilteredData

    Best Regards

      • DryMouse555's avatar
        DryMouse555
        Frequent Visitor

        Also, when I enter the same code in advance editor,

        I get this