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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
ChadK
Regular Visitor

Using fetchMoreData/dataReduction for pagination

So, I got a request from my employer to paginate the data tables, but also with a bunch of strange formatting that they like which makes it somewhere between a table and a matrix.  That stuff is no big deal, the problem I am running into is the pagination.  I wanted to use the fetchMoreData/dataReduction feature to get a window (the size of the page of data) but I can't for the life of me figure out (might be due to lack to sleep at this point) how to get the onclick event of a link to trigger the fetchmoredata and also that method doesn't seem to have an option for fetch previous data so I can get away from loading the whole data set into memory when it isn't needed.  Only the current page of data is needed and while I could load that page and then once the visual is rendered load each subsquent page's data and keep it in memory (bleh so wasteful).  Can I use a javascript function to tell my visual what the current page number should be so I can index in and out of that dataview?  It is just html but I would assume I need to make a server round trip for that extra data.

3 REPLIES 3
ChadK
Regular Visitor

Hello @dm-p 

Yes that is what I was thinking too based upon the current implementation of the fetch more data call.  The more important question for me is like an example of using a client side click event on say a link for "next page" so I don't have to load all of the data right off the bat for the 90+% of users that don't care about the data and only care about the insights.  So, I can render links only if there is more data but if I call a click event it doesn't seem to tell the visual to increment the page number and call the fetch more data method.  Do you have an example of creating a custom visual that does server round trips to pull more data?

Hi @ChadK,

 

In terms of simple examples, I only have this from a few years ago when segmented aggregation was the only option. The example is quite old and fairly similar to the examples on the page regarding how it works.

 

In my work, I've only ever needed to fetch as much as I can from the model as quickly as possible, so I don't have any experience with incremental updates mode or putting manual control around this (except for disabling fetching as a whole). This can be seen in the wild in Deneb's current data-loading strategy.

 

Regards,

 

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




dm-p
Super User
Super User

Hi @ChadK,

 

fetchMoreData only moves in one direction (incrementally) when called, so with the current functionality, you will need to handle the changes to the data view and tracking pagination via your visual logic. Previous pages will very much be present in the data view. You would probably also need to consider what might happen when the dataset is fully refreshed in the event of 'volatile' changes on the page (e.g., filtering or cross-filtering from other visuals) and whether the visual state can be reliably managed in these cases for pagination to track correctly (it might be easier to reset this back to the first page whenever this happens rather than diffing memoized data views vs. new ones and recursively calling fetchMoreData to get back to approximately the same place as before).

 

Any changes to this API would need to be a feature request to MS: pbicvsupport@microsoft.com

 

Regards,

 

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors