Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

How to Make a Table Visual Exceed 500 Rows / Looking for a Table .PBVIZ

Hey guys, I'm an intern who is trying to find a .pbviz file of a basic table visual that isn't super outdated. I'm looking for one because my managers and I noticed that the default table visual onl...
  • dm-p's avatar
    2 years ago

    Hi Anonymous,

     

    MS doesn't open source their table visual. Even if they did, core visuals and custom visuals are very different in how they work; custom visuals have a subset of curated APIs and permissions and run in sandboxed iframes (vs. core visuals which are inline div elements in the report canvas).

     

    I'm not aware of any open source examples that you can readily crib, but it would be fairly easy to integrate one of the many available JS table libraries, or even render a simple table if you're just looking to check things out before you go too far. For the latter, I wrote this intro to the table data view mapping a very long time ago (so it may not be 100% correct for the latest changes, but it may help you with rendering a basic table).

     

    However, you would still need to meet the requirement to handle more than 30K rows. You can use the fetch more data API to do this, and you'd have a couple of options. I might consider one of the following strategies if I were to attempt it:

     

    • Recursively call this when your data is loaded, to try and get the maximum rows. note that this can be expensive and not great UX, as each request is a round-trip to Power BI and you may want to manage this asynchronously.
    • Load a minimal length dataset by setting your row limit to a lot less than 30K and then invoke the API when the user scrolls the table (this would be similar to what the core visual does). Smaller windows are advantageous in that the underlying DAX query generated by Power BI is less expensive to execute and you will generally get better response times out of your UI.

     

    Regards,

     

    Daniel

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi, Anonymous 

    As Greg_Deckler said, "The default table visual can scroll for many thousands of rows." and the documentation says "Virtualization (data windowing) by using Window of 500 rows at a time.".

    So even if you have bilions of rows, they will be "incrementaly" loaded as you scroll

     

    However, if you really want to implement your own custom visual, as dm-p  said, you can draw you table using plenty of JS libs and then use the fetchMoreData API to fetch up to 1M rows

     

    By the way, dm-p already developed an implentation of the fetchMoreData API (thanks for that) with table mapping: dm-p/powerbi-visuals-fetchMoreData-SDKv3: Simple implementation of fetchMoreData in the Power BI Custom Visuals SDK v3 (github.com)