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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mastermaq
New Member

Stripe not showing all data?

New to Power BI and very impressed so far! I have added Stripe, but it is only showing data from the last couple weeks it appears. Is there a way to change this so that it loads more data?

1 ACCEPTED SOLUTION
ankitpatira
Community Champion
Community Champion

@mastermaq I am guessing you're using Stripe Content Pack. Refer to this article which says it currently extracts data over last 30 days. I am guessing since its service content pack you don't have ability to change that. What you can do is submit it as an idea so that it gets noticed and prioritised. 

View solution in original post

4 REPLIES 4
cslau5
New Member

I have recently make this work with M query loop and hope it may help others who need to retrieve historical data with Stripe API

 

let

 iLimit      = 100,
   
    getAPIResult = (nextObj) as record =>
        let response = if nextObj <> "" then Web.Contents("https://api.stripe.com/v1/refunds",[Query=[limit="100", starting_after=nextObj]])
                                        else Web.Contents("https://api.stripe.com/v1/refunds",[Query=[limit="100"]]),
            Source = Json.Document(response),
            data = try Source[data] otherwise null,
            hasMore = try Source[has_more] otherwise null,
            recordCount = List.NonNullCount(data),
            lastPosition = recordCount - 1,
            lastObj = try Source[data]{lastPosition}[id] otherwise null,
            nextObject = lastObj,
            next = if hasMore = true then nextObject else null,
            res = [Data=data,Next=next]
        in
            res,
    fullList = List.Generate(() => [i=0, res = getAPIResult("")],
        each [i]<iLimit and [res][Data]<>null,
        each [i=[i]+1, res = getAPIResult([res][Next])],
        each [res][Data]
    )
in
fullList

Thanks so much. It was very usefull!!!

ankitpatira
Community Champion
Community Champion

@mastermaq I am guessing you're using Stripe Content Pack. Refer to this article which says it currently extracts data over last 30 days. I am guessing since its service content pack you don't have ability to change that. What you can do is submit it as an idea so that it gets noticed and prioritised. 

@ankitpatira I must have missed that, thanks for the link and clarification!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors