Power BI table pagination is handled automatically by the service or report viewer, but you can control it to ensure large datasets load efficiently and users can navigate through results without performance degradation. It works by limiting the number of rows displayed on a page and providing navigation controls to move between pages, rather than loading the entire table at once. To enable this, you typically need a dataset with a primary key or a calculated column that provides a unique identifier for each row, as the service uses this to track the current page and fetch the next set of data.
What You'll Need
- A Power BI account with access to a workspace containing a dataset or report.
- A dataset that has been loaded into Power BI and is available for use in a report.
- A basic understanding of DAX (Data Analysis Expressions) for creating a unique ID column if one does not already exist.
- A browser or the Power BI Desktop application to view the report and make changes.
- Access to the necessary permissions to publish and refresh the dataset if you are making changes to the data model.
Step-by-Step
- Open your report in Power BI Desktop or the web service. Navigate to the report you wish to modify. If you are working in the web service, click the ellipsis (...) next to the report name and select "Edit in Power BI Desktop" to ensure you have full control over the data model, which is often necessary to implement pagination effectively.
- Open the data model tab. In Power BI Desktop, go to the "Modeling" tab on the ribbon and select "Manage Relationships" to view the underlying table structure. In the web service, you will need to go to the specific dataset and ensure the necessary columns are present. Pagination relies on the ability to identify distinct rows, so you must first verify that your table has a unique way to identify each record.
- Create a unique ID column (if necessary). If your table does not have a unique identifier for every row, you must create one. In Power BI Desktop, go to the table view, right-click the table, and select "New Column." In the formula bar, enter a DAX expression that combines other columns to form a unique string, such as
Table[Column1] & "-" & Table[Column2]. Alternatively, use theROW_NUMBER()function if your data source supports window functions directly within the query editor. This column will serve as the anchor for pagination. - Configure the table visual. Drag the table visual onto your report canvas. Click on the visual to open the "Visualizations" pane on the right. Locate the "Data" tab within the visual settings. Ensure that the unique ID column you created in the previous step is added to the "Values" field well. This step is crucial because the Power BI service uses this field to count rows and determine where one page ends and the next begins.
- Set the page size. With the table visual selected, look for the "Data” tab in the Visualizations pane. You will see an option labeled “Rows per page.” Click on this field and enter the number of rows you want to display on each page, such as 25 or 50. This is the most direct way to control the pagination limit. If this specific setting does not appear, it may be hidden or disabled depending on your version; in that case, proceed to the next step to use the alternative method.
- Enable pagination via the dataset settings (if the visual setting is unavailable). Navigate to the dataset in your workspace. Select the settings icon (usually a gear or cog) and choose "Settings." Look for the section labeled "Data load settings" or "Data source settings." Here, you may find options to limit the number of rows returned. If this is available, set the limit to your desired number. Note that this method applies to the entire dataset and may affect other visuals that pull from it, so it is a more global change.
- Refresh the report. After making these changes, go to the Home tab in Power BI Desktop and select "Refresh” to ensure the unique ID column is calculated correctly for the latest data. On the web service, click the ellipsis (...) on the report and select "Refresh.” This ensures that any new rows added to your source data are properly accounted for in the pagination logic.
- Test the pagination. View the report in the web service or the Power BI mobile app. Scroll to the bottom of the table visual. You should see a pagination bar with page numbers and navigation arrows. Click the arrows to verify that the table updates correctly and that the unique ID column is stable across pages. If the ID column changes (for example, due to a sort order change), the pagination may jump or behave erratically, so ensure your sort order is consistent.
Common Mistakes
The most frequent error is attempting to paginate a table that lacks a unique, stable identifier. If the table has duplicate keys or the unique key changes based on the sort order, the pagination engine will not know where to start or stop, resulting in incorrect page breaks. Another mistake is setting the page size too high, which can cause the report to load slowly or time out, especially with complex DAX measures. Users often forget to refresh the dataset after creating the unique ID column, leading to errors where new data is not included in the pages.
Tips
Always sort your table by the unique ID column before enabling pagination to ensure consistency. If your data source is SQL Server, consider using the TOP clause in your query to limit the data at the source, which is often more efficient than letting Power BI handle the pagination in the report layer. When working with very large tables, use a summary table instead of the detailed table for the visual, as this reduces the amount of data Power BI needs to process for each page view.
Troubleshooting
If the pagination bar does not appear at the bottom of your table, first check that you have a unique ID column in the Values well. If the bar is present but the pages are empty or show the same data, it is likely because the unique ID column is not stable; try sorting by the ID column and refreshing the report. If the report becomes unresponsive when you click the pagination arrows, your dataset may be too large for the current page size; try reducing the rows per page setting or optimizing your DAX measures to improve performance. If you are using a file-based data source like Excel, ensure the file is not open in another application, as this can cause locking issues during the refresh process.
Frequently Asked Questions
Can I customize the pagination text, such as showing "Showing 1-10 of 100"?
Power BI does not have a built-in option to customize the pagination text in the standard table visual. The pagination bar simply displays page numbers and navigation arrows. To achieve custom text, you would need to create a custom visual or use a workaround involving a separate measure that counts the total rows and a slicer to filter the table, though this is significantly more complex than the native pagination.
Does pagination work on all visual types in Power BI?
No, pagination is primarily supported for table visuals and some matrix visuals. Standard bar charts, line charts, and cards do not have a rows per page setting because they display aggregated data rather than a list of individual rows. If you need to paginate a list of items, you must use a table or matrix visual.
Why does my pagination jump from page 1 to page 5?
This usually happens if the unique ID column you are using for pagination is not truly unique or if the data is being sorted differently on different pages. For example, if the sort order is not applied consistently, the engine might misinterpret where the start of a new page is, causing it to skip over rows. Ensure that the sort order is locked and consistent across the entire table.
Is there a limit to the number of rows I can paginate?
There is no explicit hard limit set by Power BI on the number of rows you can paginate, but there are practical limits imposed by your data source and the service's time-out settings. Very large datasets can cause the report to load slowly or time out, so it is best practice to keep the page size reasonable (e.g., under 1,000 rows) and consider using summary tables for better performance.
Can I use DAX to create a custom pagination experience?
You can use DAX to create a table that includes a calculated column for the row number, but you cannot use DAX to directly manipulate the pagination controls of the standard table visual. You would need to build a custom visual or use a workaround involving a slicer that filters the table based on the row number, which is more advanced and requires custom development.