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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
rpiboy_1
Helper V
Helper V

Dataflow Gen 1 caching old function version?

I have a function in a Dataflow Gen1 (code below). I just updated the function to include the Datefilter argument.

 

With the update the primary query (RawData) where this function is called works fine, all steps complete. There are some additional queries that Reference the RawData query. The subsequent queries isolate specific columns with list records and then expand the lists. I then filter out any null/blank rows. The problem is on all the sub queries, on the filter step an error is being returned that says:

rpiboy_1_1-1730737758226.png

The error reference is clearly in relation to the function code shown below. However, the function is correct and the RawData query is correct, I don't understand why this error is being triggered on filter.

If I go into Details this is what I see. If I copy paste the Mash-up, everything looks correct, including the agruements being passed. It feels like somehow there is a mix-up between old and new here, as previously only three aguements were passed and with the most recent update four argument need (and should be) passed. As you can see in the function code most of this is interalized in the function and the only thing being passed into the function is the object type. In reality this function could be fully integrated into the RawData query, its mostly isolated so that the pattern can easily be re-used for other object types and endpoints from the vendor (Freshdesk).

 

rpiboy_1_0-1730737741726.png

Any thoughts as to what is happening here that is throwing things off?

 

 

 

(URLobjectType as text)=>
    let
        DateFilter =
            DateTime.ToText(
                DateTime.From(
                    Date.AddYears(
                        Date.StartOfYear(
                            DateTime.Date(
                                DateTime.LocalNow()
                            )
                        ),  
                        -1
                    )
                ),
                [Format="yyyy-MM-dd'T'HH:mm:ss'Z'"]
            ),
        GetData = (
                URLobjectType as text,
                objectsPerPage as text,
                pageNo as number,
                DateFilter as text
            ) =>
            let
                PageNum = Number.ToText(pageNo),
                Response = Json.Document(
                    Web.Contents(
                        "https://companyurl.freshdesk.com/api/v2/",
                        [
                            RelativePath = URLobjectType,
                            Query = [per_page = objectsPerPage, page = PageNum, updated_since = DateFilter, include = "stats"]
                        ]
                    ),
                    65001
                )
            in
                Response,

        IterateEndPoint =
            List.Generate(
                () => [ pageNo = 1, Data = GetData( URLobjectType, "100", 1, DateFilter) ],
                    each not List.IsEmpty([Data]),
                    each [
                        pageNo = [pageNo]+1,
                        Data = GetData( URLobjectType, "100", [pageNo])
                    ],
                    each [Data]
            )
    in
        IterateEndPoint

 

 

 

1 ACCEPTED SOLUTION
rpiboy_1
Helper V
Helper V

Finally found my mistake in my own code. Forgot that the function was called twice in List.Generate, and my eyes passed over it completely. Sigh... 'as you were'.

View solution in original post

1 REPLY 1
rpiboy_1
Helper V
Helper V

Finally found my mistake in my own code. Forgot that the function was called twice in List.Generate, and my eyes passed over it completely. Sigh... 'as you were'.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Kudoed Authors