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
viniciuscastilh
Frequent Visitor

repeat consult

Hi

I need to repeat the query N times
In this case, it is a simple query that gives me 50 results, and when I run it again it gives me 50 more results How can I add these results, for example be 3000 results and I can pull the 3000
It would be like doing this query several times and I save all the results, of course stipulate how many times I would need to repeat

 

let
    Fonte = Json.Document(Web.Contents("-----", [Headers=[Authorization="Bearer -----"]])),
    results = Fonte[results],
    #"Convertido para Tabela" = Table.FromList(results, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
    #"Convertido para Tabela"

 

 

Thanks

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

@viniciuscastilh 

See it all at work in the attached file.

Note I have changed the code for your base query a bit for the example

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

View solution in original post

4 REPLIES 4
AlB
Community Champion
Community Champion

@viniciuscastilh 

See it all at work in the attached file.

Note I have changed the code for your base query a bit for the example

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

AlB
Community Champion
Community Champion

Hi @viniciuscastilh 

1. Create a function with the code for the query you want to repeat; name it  function_  for instance

2. Create another query that calls ont he previous one N times:

 

let
    N_ = 10, //update as needed
    list_ = List.Numbers(1,N_),
    res_ = List.Transform(list_, function_),
    final_ = Table.Combine(res_)
in
    final_

 

 This does a union of all the N tables. You can change how you combine them as needed

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

 

Thanks
It works, now I just need to circumvent the cache, because it is always pulling the first 50 results, you know an effective way to do it?
I know some, but it doesn't always work

@viniciuscastilh , I think it's necessary to go thru documentaiton of API from which you pull data.


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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